/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('alb', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddEntriesToAclRequest {
  aclEntries?: [ 
    {
      description?: string(name='Description', description='The description of the ACL entry. The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

You can add at most 20 entries in each call.', example='test-entry'),
      entry?: string(name='Entry', description='The CIDR block in the ACL entry.

This parameter is required.', example='10.0.1.0/24'),
    }
  ](name='AclEntries', description='The ACL entries that you want to add. You can add at most 20 entries in each call.

This parameter is required.'),
  aclId?: string(name='AclId', description='The ID of the ACL.

This parameter is required.', example='nacl-hp34s2h0xx1ht4nwo****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
}

model AddEntriesToAclResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model AddEntriesToAclResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddEntriesToAclResponseBody(name='body'),
}

/**
 * @summary Adds IP entries to an access control list (ACL).
 *
 * @description *   Each ACL can contain IP addresses or CIDR blocks. Take note of the following limits on ACLs:
 *     *   The maximum number of IP entries that can be added to an ACL with each Alibaba Cloud account at a time: 20
 *     *   The maximum number of IP entries that each ACL can contain: 1,000
 * *   **AddEntriesToAcl** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAclEntries](https://help.aliyun.com/document_detail/213616.html) operation to query the status of the task.
 *     *   If the ACL is in the **Adding** state, the IP entries are being added.
 *     *   If the ACL is in the **Available** state, the IP entries are added.
 *
 * @param request AddEntriesToAclRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddEntriesToAclResponse
 */
async function addEntriesToAclWithOptions(request: AddEntriesToAclRequest, runtime: $RuntimeOptions): AddEntriesToAclResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aclEntries)) {
    query['AclEntries'] = request.aclEntries;
  }
  if (!$isNull(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddEntriesToAcl',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds IP entries to an access control list (ACL).
 *
 * @description *   Each ACL can contain IP addresses or CIDR blocks. Take note of the following limits on ACLs:
 *     *   The maximum number of IP entries that can be added to an ACL with each Alibaba Cloud account at a time: 20
 *     *   The maximum number of IP entries that each ACL can contain: 1,000
 * *   **AddEntriesToAcl** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAclEntries](https://help.aliyun.com/document_detail/213616.html) operation to query the status of the task.
 *     *   If the ACL is in the **Adding** state, the IP entries are being added.
 *     *   If the ACL is in the **Available** state, the IP entries are added.
 *
 * @param request AddEntriesToAclRequest
 * @return AddEntriesToAclResponse
 */
async function addEntriesToAcl(request: AddEntriesToAclRequest): AddEntriesToAclResponse {
  var runtime = new $RuntimeOptions{};
  return addEntriesToAclWithOptions(request, runtime);
}

model AddServersToServerGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: prechecks the request, but does not add a backend server to a server group. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

This parameter is required.', example='sgp-atstuj3rtop****'),
  servers?: [ 
    {
      description?: string(name='Description', description='The description of the backend server. The description must be 2 to 256 characters in length and cannot start with http:// or https://.', example='test'),
      port?: int32(name='Port', description='The port that is used by the backend server. Valid values: **1** to **65535**. You can specify at most 200 servers in each call.

>  This parameter is required if you set **ServerType** to **Ecs**, **Eni**, **Eci**, or **Ip**. You do not need to set this parameter if **ServerType** is set to **Fc**.', example='80'),
      remoteIpEnabled?: boolean(name='RemoteIpEnabled', description='Specifies whether to enable the remote IP feature. You can specify at most 200 servers in each call. Default values:

*   **true**: enables the feature.
*   **false**: disables the feature.

>  This parameter takes effect only when **ServerType** is set to **Ip**.', example='false'),
      serverId?: string(name='ServerId', description='The ID of the server group. You can specify at most 200 servers in each call.

*   If the server group is of the **Instance** type, set ServerId to the ID of a resource of the **Ecs**, **Eni**, or **Eci** type.
*   If the server group is of the **Ip** type, set this parameter to IP addresses.
*   If the server group is of the **Fc** type, set ServerId to an Alibaba Cloud Resource Name (ARN).

This parameter is required.', example='ecs-bp67acfmxazb4p****'),
      serverIp?: string(name='ServerIp', description='The IP address of the backend server. You can specify at most 200 servers in each call.

>  You do not need to set this parameter if you set **ServerType** to **Fc**.', example='192.168.1.1'),
      serverType?: string(name='ServerType', description='The type of the backend server. You can specify at most 200 servers in each call. Default values:

*   **Ecs**: Elastic Compute Service (ECS) instance
*   **Eni**: elastic network interface (ENI)
*   **Eci**: elastic container instance
*   **Ip**: IP address
*   **Fc**: Function Compute

This parameter is required.', example='Ecs'),
      weight?: int32(name='Weight', description='The weight of the backend server. Valid values: **0** to **100**. Default value: **100**. If the value is set to **0**, no requests are forwarded to the server. You can specify at most 200 servers in each call.

>  You do not need to set this parameter if you set **ServerType** to **Fc**.', example='100'),
    }
  ](name='Servers', description='The backend servers. You can specify at most 200 servers in each call.

This parameter is required.'),
}

model AddServersToServerGroupResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous job.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model AddServersToServerGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddServersToServerGroupResponseBody(name='body'),
}

/**
 * @summary Adds backend servers to a server group.
 *
 * @description **AddServersToServerGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background.
 * 1.  You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the status of a server group.
 * *   If a server group is in the **Configuring** state, it indicates that the server group is being modified.
 * *   If a server group is in the **Available** state, it indicates that the server group is running.
 * 2.  You can call the [ListServerGroupServers](https://help.aliyun.com/document_detail/213628.html) operation to query the status of a backend server.
 * *   If a backend server is in the **Adding** state, it indicates that the backend server is being added to a server group.
 * *   If a backend server is in the **Available** state, it indicates that the server is running.
 *
 * @param request AddServersToServerGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddServersToServerGroupResponse
 */
async function addServersToServerGroupWithOptions(request: AddServersToServerGroupRequest, runtime: $RuntimeOptions): AddServersToServerGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.serverGroupId)) {
    query['ServerGroupId'] = request.serverGroupId;
  }
  if (!$isNull(request.servers)) {
    query['Servers'] = request.servers;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddServersToServerGroup',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds backend servers to a server group.
 *
 * @description **AddServersToServerGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background.
 * 1.  You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the status of a server group.
 * *   If a server group is in the **Configuring** state, it indicates that the server group is being modified.
 * *   If a server group is in the **Available** state, it indicates that the server group is running.
 * 2.  You can call the [ListServerGroupServers](https://help.aliyun.com/document_detail/213628.html) operation to query the status of a backend server.
 * *   If a backend server is in the **Adding** state, it indicates that the backend server is being added to a server group.
 * *   If a backend server is in the **Available** state, it indicates that the server is running.
 *
 * @param request AddServersToServerGroupRequest
 * @return AddServersToServerGroupResponse
 */
async function addServersToServerGroup(request: AddServersToServerGroupRequest): AddServersToServerGroupResponse {
  var runtime = new $RuntimeOptions{};
  return addServersToServerGroupWithOptions(request, runtime);
}

model ApplyHealthCheckTemplateToServerGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  healthCheckTemplateId?: string(name='HealthCheckTemplateId', description='The template ID.

This parameter is required.', example='hct-bp1qjwo61pqz3ahltv****'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

This parameter is required.', example='sgp-n80wyad08u0tox****'),
}

model ApplyHealthCheckTemplateToServerGroupResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model ApplyHealthCheckTemplateToServerGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ApplyHealthCheckTemplateToServerGroupResponseBody(name='body'),
}

/**
 * @summary Applies a health check template to a server group.
 *
 * @param request ApplyHealthCheckTemplateToServerGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ApplyHealthCheckTemplateToServerGroupResponse
 */
async function applyHealthCheckTemplateToServerGroupWithOptions(request: ApplyHealthCheckTemplateToServerGroupRequest, runtime: $RuntimeOptions): ApplyHealthCheckTemplateToServerGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.healthCheckTemplateId)) {
    query['HealthCheckTemplateId'] = request.healthCheckTemplateId;
  }
  if (!$isNull(request.serverGroupId)) {
    query['ServerGroupId'] = request.serverGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ApplyHealthCheckTemplateToServerGroup',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Applies a health check template to a server group.
 *
 * @param request ApplyHealthCheckTemplateToServerGroupRequest
 * @return ApplyHealthCheckTemplateToServerGroupResponse
 */
async function applyHealthCheckTemplateToServerGroup(request: ApplyHealthCheckTemplateToServerGroupRequest): ApplyHealthCheckTemplateToServerGroupResponse {
  var runtime = new $RuntimeOptions{};
  return applyHealthCheckTemplateToServerGroupWithOptions(request, runtime);
}

model AssociateAclsWithListenerRequest {
  aclIds?: [ string ](name='AclIds', description='The IDs of the ACLs. You can specify up to three IDs in each call.

This parameter is required.'),
  aclType?: string(name='AclType', description='The type of the ACL. Valid values:

*   **White**: a whitelist. Only requests from the IP addresses or CIDR blocks in the ACL are forwarded. The whitelist applies to scenarios in which you want to allow only specific IP addresses to access an application. Your service may be adversely affected if the whitelist is not properly configured. If a whitelist is configured for a listener, only requests from IP addresses that are added to the whitelist are forwarded by the listener. If you enable a whitelist but do not add an IP address to the whitelist, the listener forwards all requests.
*   **Black**: a blacklist. All requests from the IP addresses or CIDR blocks in the ACL are blocked. The blacklist applies to scenarios in which you want to block access from specific IP addresses to an application. If a blacklist is configured for a listener but no IP address is added to the blacklist, the listener forwards all requests.

This parameter is required.', example='White'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
}

model AssociateAclsWithListenerResponseBody = {
  jobId?: string(name='JobId', description='The synchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model AssociateAclsWithListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AssociateAclsWithListenerResponseBody(name='body'),
}

/**
 * @summary Associates access control lists (ACLs) with a listener.
 *
 * @description **DeleteDhcpOptionsSet** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAclRelations](https://help.aliyun.com/document_detail/213618.html) operation to query the status of the task.
 * *   If an ACL is in the **Associating** state, the ACL is being associated with a listener.
 * *   If an ACL is in the **Associated** state, the ACL is associated with a listener.
 *
 * @param request AssociateAclsWithListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AssociateAclsWithListenerResponse
 */
async function associateAclsWithListenerWithOptions(request: AssociateAclsWithListenerRequest, runtime: $RuntimeOptions): AssociateAclsWithListenerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aclIds)) {
    query['AclIds'] = request.aclIds;
  }
  if (!$isNull(request.aclType)) {
    query['AclType'] = request.aclType;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AssociateAclsWithListener',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Associates access control lists (ACLs) with a listener.
 *
 * @description **DeleteDhcpOptionsSet** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAclRelations](https://help.aliyun.com/document_detail/213618.html) operation to query the status of the task.
 * *   If an ACL is in the **Associating** state, the ACL is being associated with a listener.
 * *   If an ACL is in the **Associated** state, the ACL is associated with a listener.
 *
 * @param request AssociateAclsWithListenerRequest
 * @return AssociateAclsWithListenerResponse
 */
async function associateAclsWithListener(request: AssociateAclsWithListenerRequest): AssociateAclsWithListenerResponse {
  var runtime = new $RuntimeOptions{};
  return associateAclsWithListenerWithOptions(request, runtime);
}

model AssociateAdditionalCertificatesWithListenerRequest {
  certificates?: [ 
    {
      certificateId?: string(name='CertificateId', description='The ID of the certificate. Only server certificates are supported.

This parameter is required.', example='cert-123'),
    }
  ](name='Certificates', description='The extended validation certificates that you want to add to the listener.

This parameter is required.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='true'),
  listenerId?: string(name='ListenerId', description='The listener ID. This parameter is supported only by HTTPS and QUIC listeners.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
}

model AssociateAdditionalCertificatesWithListenerResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model AssociateAdditionalCertificatesWithListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AssociateAdditionalCertificatesWithListenerResponseBody(name='body'),
}

/**
 * @summary Associates additional certificates with a listener.
 *
 * @description **AssociateAdditionalCertificatesWithListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetListenerAttribute](https://help.aliyun.com/document_detail/2254865.html) operation to query the status of the task:
 * *   If the HTTPS or QUIC listener is in the **Associating** state, the additional certificates are being associated.
 * *   If the HTTPS or QUIC listener is in the **Associated** state, the additional certificates are associated.
 *
 * @param request AssociateAdditionalCertificatesWithListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AssociateAdditionalCertificatesWithListenerResponse
 */
async function associateAdditionalCertificatesWithListenerWithOptions(request: AssociateAdditionalCertificatesWithListenerRequest, runtime: $RuntimeOptions): AssociateAdditionalCertificatesWithListenerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certificates)) {
    query['Certificates'] = request.certificates;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AssociateAdditionalCertificatesWithListener',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Associates additional certificates with a listener.
 *
 * @description **AssociateAdditionalCertificatesWithListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetListenerAttribute](https://help.aliyun.com/document_detail/2254865.html) operation to query the status of the task:
 * *   If the HTTPS or QUIC listener is in the **Associating** state, the additional certificates are being associated.
 * *   If the HTTPS or QUIC listener is in the **Associated** state, the additional certificates are associated.
 *
 * @param request AssociateAdditionalCertificatesWithListenerRequest
 * @return AssociateAdditionalCertificatesWithListenerResponse
 */
async function associateAdditionalCertificatesWithListener(request: AssociateAdditionalCertificatesWithListenerRequest): AssociateAdditionalCertificatesWithListenerResponse {
  var runtime = new $RuntimeOptions{};
  return associateAdditionalCertificatesWithListenerWithOptions(request, runtime);
}

model AttachCommonBandwidthPackageToLoadBalancerRequest {
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The EIP bandwidth plan ID.

This parameter is required.', example='cbwp-bp1pzf0ym72pu3y76****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**(default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.

This parameter is required.', example='alb-d676fho813rmu3****'),
  regionId?: string(name='RegionId', description='The region ID of the ALB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/36063.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model AttachCommonBandwidthPackageToLoadBalancerResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='2EF39708-974B-5E74-AFF5-3445263035A8'),
}

model AttachCommonBandwidthPackageToLoadBalancerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachCommonBandwidthPackageToLoadBalancerResponseBody(name='body'),
}

/**
 * @summary Associates an EIP bandwidth plan with an Application Load Balancer (ALB) instance.
 *
 * @description **AttachCommonBandwidthPackageToLoadBalancer** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) to query the status of the task.
 * *   If the ALB instance is in the **Configuring** state, the EIP bandwidth plan is being associated with the ALB instance.
 * *   If the ALB instance is in the **Active** state, the EIP bandwidth plan is associated with the ALB instance.
 *
 * @param request AttachCommonBandwidthPackageToLoadBalancerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachCommonBandwidthPackageToLoadBalancerResponse
 */
async function attachCommonBandwidthPackageToLoadBalancerWithOptions(request: AttachCommonBandwidthPackageToLoadBalancerRequest, runtime: $RuntimeOptions): AttachCommonBandwidthPackageToLoadBalancerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bandwidthPackageId)) {
    query['BandwidthPackageId'] = request.bandwidthPackageId;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AttachCommonBandwidthPackageToLoadBalancer',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Associates an EIP bandwidth plan with an Application Load Balancer (ALB) instance.
 *
 * @description **AttachCommonBandwidthPackageToLoadBalancer** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) to query the status of the task.
 * *   If the ALB instance is in the **Configuring** state, the EIP bandwidth plan is being associated with the ALB instance.
 * *   If the ALB instance is in the **Active** state, the EIP bandwidth plan is associated with the ALB instance.
 *
 * @param request AttachCommonBandwidthPackageToLoadBalancerRequest
 * @return AttachCommonBandwidthPackageToLoadBalancerResponse
 */
async function attachCommonBandwidthPackageToLoadBalancer(request: AttachCommonBandwidthPackageToLoadBalancerRequest): AttachCommonBandwidthPackageToLoadBalancerResponse {
  var runtime = new $RuntimeOptions{};
  return attachCommonBandwidthPackageToLoadBalancerWithOptions(request, runtime);
}

model CancelShiftLoadBalancerZonesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='true'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the ALB instance.

This parameter is required.', example='alb-o9ulmq5hgn68jk****'),
  zoneMappings?: [ 
    {
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch in the zone. By default, each zone uses one vSwitch and one subnet.

This parameter is required.', example='vsw-bp1rmcrwg3erh1fh8****'),
      zoneId?: string(name='ZoneId', description='The zone ID. You can call the [DescribeZones](https://help.aliyun.com/document_detail/189196.html) operation to query the most recent zone list.

This parameter is required.', example='cn-hangzhou-a'),
    }
  ](name='ZoneMappings', description='The mappings between zones and vSwitches.

>  You can add only one zone in each call.

This parameter is required.'),
}

model CancelShiftLoadBalancerZonesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
}

model CancelShiftLoadBalancerZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelShiftLoadBalancerZonesResponseBody(name='body'),
}

/**
 * @summary Adds the elastic IP address (EIP) and virtual IP address (VIP) of a zone to a DNS record.
 *
 * @description This operation is supported only by Application Load Balancer (ALB) instances that use static IP addresses. Before you call this operation, you must call the StartShiftLoadBalancerZones operation to remove the zone from the ALB instance.
 *
 * @param request CancelShiftLoadBalancerZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelShiftLoadBalancerZonesResponse
 */
async function cancelShiftLoadBalancerZonesWithOptions(request: CancelShiftLoadBalancerZonesRequest, runtime: $RuntimeOptions): CancelShiftLoadBalancerZonesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.zoneMappings)) {
    query['ZoneMappings'] = request.zoneMappings;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelShiftLoadBalancerZones',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds the elastic IP address (EIP) and virtual IP address (VIP) of a zone to a DNS record.
 *
 * @description This operation is supported only by Application Load Balancer (ALB) instances that use static IP addresses. Before you call this operation, you must call the StartShiftLoadBalancerZones operation to remove the zone from the ALB instance.
 *
 * @param request CancelShiftLoadBalancerZonesRequest
 * @return CancelShiftLoadBalancerZonesResponse
 */
async function cancelShiftLoadBalancerZones(request: CancelShiftLoadBalancerZonesRequest): CancelShiftLoadBalancerZonesResponse {
  var runtime = new $RuntimeOptions{};
  return cancelShiftLoadBalancerZonesWithOptions(request, runtime);
}

model CreateAScriptsRequest {
  AScripts?: [ 
    {
      AScriptName?: string(name='AScriptName', description='The name of the AScript rule.

The name must be 2 to 128 character in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

This parameter is required.', example='test'),
      enabled?: boolean(name='Enabled', description='Specifies whether to enable the AScript rule. Valid values:

*   **true**
*   **false** (default)', example='false'),
      extAttributeEnabled?: boolean(name='ExtAttributeEnabled', description='Specifies whether to enable the extended attributes of the AScript rule. Valid values:

*   true
*   false (default)', example='true'),
      extAttributes?: [ 
        {
          attributeKey?: string(name='AttributeKey', description='The attribute name.

Set the value to **EsDebug**, which specifies that if requests carry the _es_dbg parameter and the value is the specified key, the debugging header is enabled to output the execution result.', example='EsDebug'),
          attributeValue?: string(name='AttributeValue', description='The attribute value, which must be 1 to 128 characters in length, and can contain letters or digits.', example='test123'),
        }
      ](name='ExtAttributes', description='The extended attributes.'),
      scriptContent?: string(name='ScriptContent', description='The content of the AScript rule.

This parameter is required.', example='if and(match_re($uri, \\\\"^/1.txt$\\\\"), $arg_type) {   rewrite(concat(\\\\"/1.\\\\", $arg_type), \\\\"break\\\\") }'),
    }
  ](name='AScripts', description='The information about the AScript rules.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**(default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  listenerId?: string(name='ListenerId', description='The listener ID.

This parameter is required.', example='lsn-6hfq3zs0x04ibn****'),
}

model CreateAScriptsResponseBody = {
  AScriptIds?: [ 
    {
      AScriptId?: string(name='AScriptId', description='The AScript rule ID.', example='as-xvq5igaa7uv6vr****'),
    }
  ](name='AScriptIds', description='The AScript rule IDs.'),
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='5c607642-535e-4e06-9d77-df53049b****'),
  requestId?: string(name='RequestId', description='The request ID.', example='BF0FE763-9603-558F-A55B-0F4B9A3E3C02'),
}

model CreateAScriptsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAScriptsResponseBody(name='body'),
}

/**
 * @summary Creates AScript rules.
 *
 * @description ### [](#)Prerequisites
 * *   A standard or WAF-enabled Application Load Balancer (ALB) instance is created. For more information, see [CreateLoadBalancer](https://help.aliyun.com/document_detail/214358.html).
 * ### [](#)Usage notes
 * **CreateAScripts** an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAScripts](https://help.aliyun.com/document_detail/472574.html) operation to query the status of a script.
 * *   If the script is in the **Creating** state, the script is being created.
 * *   If the script is in the **Available**, the script is created.
 *
 * @param request CreateAScriptsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAScriptsResponse
 */
async function createAScriptsWithOptions(request: CreateAScriptsRequest, runtime: $RuntimeOptions): CreateAScriptsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.AScripts)) {
    query['AScripts'] = request.AScripts;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateAScripts',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates AScript rules.
 *
 * @description ### [](#)Prerequisites
 * *   A standard or WAF-enabled Application Load Balancer (ALB) instance is created. For more information, see [CreateLoadBalancer](https://help.aliyun.com/document_detail/214358.html).
 * ### [](#)Usage notes
 * **CreateAScripts** an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAScripts](https://help.aliyun.com/document_detail/472574.html) operation to query the status of a script.
 * *   If the script is in the **Creating** state, the script is being created.
 * *   If the script is in the **Available**, the script is created.
 *
 * @param request CreateAScriptsRequest
 * @return CreateAScriptsResponse
 */
async function createAScripts(request: CreateAScriptsRequest): CreateAScriptsResponse {
  var runtime = new $RuntimeOptions{};
  return createAScriptsWithOptions(request, runtime);
}

model CreateAclRequest {
  aclName?: string(name='AclName', description='The name of the ACL. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='test-acl'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. ClientToken can contain only ASCII characters.

>  If you do not set this parameter, the system uses **RequestId** as **ClientToken**. The value of **RequestId** may be different for each API request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to check the request without performing the operation. Valid values:

*   **true**: checks the request without performing the operation. The system checks the required parameters, request syntax, and limits. If the request fails the check, an error message is returned. If the request passes the check, the `DryRunOperation` error code is returned.
*   **false** (default): sends the request. If the request passes the check, an HTTP 2xx status code is returned and the operation is performed.', example='true'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-atstuj3rtop****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tag', description='The tags.'),
}

model CreateAclResponseBody = {
  aclId?: string(name='AclId', description='The ID of the ACL.', example='nacl-hp34s2h0xx1ht4nwo****'),
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model CreateAclResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAclResponseBody(name='body'),
}

/**
 * @summary Creates an access control list (ACL) in a region.
 *
 * @description ## Usage notes
 * The **CreateAcl** operation is asynchronous. After you send a request, the system returns a request ID. However, the operation is still being performed in the system background. You can call the [ListAcls](https://help.aliyun.com/document_detail/213617.html) operation to query the status of an ACL:
 * *   If an ACL is in the **Creating** state, the ACL is being created.
 * *   If an ACL is in the **Available** state, the ACL is created.
 *
 * @param request CreateAclRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAclResponse
 */
async function createAclWithOptions(request: CreateAclRequest, runtime: $RuntimeOptions): CreateAclResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aclName)) {
    query['AclName'] = request.aclName;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateAcl',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates an access control list (ACL) in a region.
 *
 * @description ## Usage notes
 * The **CreateAcl** operation is asynchronous. After you send a request, the system returns a request ID. However, the operation is still being performed in the system background. You can call the [ListAcls](https://help.aliyun.com/document_detail/213617.html) operation to query the status of an ACL:
 * *   If an ACL is in the **Creating** state, the ACL is being created.
 * *   If an ACL is in the **Available** state, the ACL is created.
 *
 * @param request CreateAclRequest
 * @return CreateAclResponse
 */
async function createAcl(request: CreateAclRequest): CreateAclResponse {
  var runtime = new $RuntimeOptions{};
  return createAclWithOptions(request, runtime);
}

model CreateHealthCheckTemplateRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a **2xx** HTTP status code is returned and the operation is performed.', example='true'),
  healthCheckCodes?: [ string ](name='HealthCheckCodes', description='The HTTP status codes that indicate a healthy backend server.', example='5'),
  healthCheckConnectPort?: int32(name='HealthCheckConnectPort', description='The port that is used for health checks.

Valid values: **0 to 65535**.

Default value: **0**. If you set the value to 0, the port of a backend server is used for health checks.', example='80'),
  healthCheckHost?: string(name='HealthCheckHost', description='The domain name that is used for health checks. Valid values:

*   **$SERVER_IP**: the private IP addresses of backend servers. If an IP address is specified, or this parameter is not specified, the ALB instance uses the private IP addresses of backend servers as domain names for health checks.
*   **domain**: The domain name must be 1 to 80 characters in length, and can contain letters, digits, periods (.), and hyphens (-).

>  This parameter takes effect only if `HealthCheckProtocol` is set to **HTTP** or **HTTPS**.', example='$_ip'),
  healthCheckHttpVersion?: string(name='HealthCheckHttpVersion', description='The HTTP version for health checks.

Valid values: **HTTP 1.0** and **HTTP 1.1**.

Default value: **HTTP 1.1**.

>  This parameter is available only if `HealthCheckProtocol` is set to **HTTP** or **HTTPS**.', example='HTTP 1.0'),
  healthCheckInterval?: int32(name='HealthCheckInterval', description='The interval at which health checks are performed.

Valid values: **1 to 50**.

Default value: **2**.', example='2'),
  healthCheckMethod?: string(name='HealthCheckMethod', description='The HTTP method that is used for health checks. Valid values:

*   **HEAD** (default): By default, HTTP and HTTPS health checks use the HEAD method.
*   **POST**: gRPC health checks use the POST method by default.
*   **GET**: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.

>  This parameter is available only if **HealthCheckProtocol** is set to **HTTP**, **HTTPS**, or **gRPC**.', example='HEAD'),
  healthCheckPath?: string(name='HealthCheckPath', description='The URL that is used for health checks.

The URL must be 1 to 80 characters in length, and can contain letters, digits, the following special characters: - / . % ? # &, and the following extended characters: `_ ; ~ ! ( ) * [ ] @ $ ^ : \\\\" , +`. The URL must start with a forward slash (/).

>  This parameter is available only if `HealthCheckProtocol` is set to **HTTP** or **HTTPS**.', example='/test/index.html'),
  healthCheckProtocol?: string(name='HealthCheckProtocol', description='The protocol that is used for health checks. Valid values:

*   **HTTP** (default): HTTP health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers.
*   **HTTPS**: The ALB instance sends HEAD or GET requests, which simulate browser requests, to check whether the backend server is healthy. HTTPS supports encryption and provides higher security than HTTP.
*   **TCP**: TCP health checks send TCP SYN packets to a backend server to check whether the port of the backend server is reachable.
*   **gRPC**: gRPC health checks send POST or GET requests to a backend server to check whether the backend server is healthy.', example='HTTP'),
  healthCheckTemplateName?: string(name='HealthCheckTemplateName', description='The name of the health check template.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.

This parameter is required.', example='HealthCheckTemplate1'),
  healthCheckTimeout?: int32(name='HealthCheckTimeout', description='The timeout period of a health check response. If a backend server does not respond within the specified timeout period, the backend server is declared unhealthy.

Valid values: **1 to 300**. Unit: seconds.

Default value: **5**.', example='5'),
  healthyThreshold?: int32(name='HealthyThreshold', description='The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status is changed from **fail** to **success**.

Valid values: **2 to 10**.

Default value: **3**.', example='4'),
  resourceGroupId?: string(name='ResourceGroupId'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tag', description='The tags.'),
  unhealthyThreshold?: int32(name='UnhealthyThreshold', description='The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status is changed from **success** to **fail**.

Valid values: **2 to 10**.

Default value: **3**.', example='4'),
}

model CreateHealthCheckTemplateResponseBody = {
  healthCheckTemplateId?: string(name='HealthCheckTemplateId', description='The ID of the health check template.', example='hct-1224334'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model CreateHealthCheckTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateHealthCheckTemplateResponseBody(name='body'),
}

/**
 * @summary Creates a health check template in a region.
 *
 * @param request CreateHealthCheckTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateHealthCheckTemplateResponse
 */
async function createHealthCheckTemplateWithOptions(request: CreateHealthCheckTemplateRequest, runtime: $RuntimeOptions): CreateHealthCheckTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.healthCheckCodes)) {
    query['HealthCheckCodes'] = request.healthCheckCodes;
  }
  if (!$isNull(request.healthCheckConnectPort)) {
    query['HealthCheckConnectPort'] = request.healthCheckConnectPort;
  }
  if (!$isNull(request.healthCheckHost)) {
    query['HealthCheckHost'] = request.healthCheckHost;
  }
  if (!$isNull(request.healthCheckHttpVersion)) {
    query['HealthCheckHttpVersion'] = request.healthCheckHttpVersion;
  }
  if (!$isNull(request.healthCheckInterval)) {
    query['HealthCheckInterval'] = request.healthCheckInterval;
  }
  if (!$isNull(request.healthCheckMethod)) {
    query['HealthCheckMethod'] = request.healthCheckMethod;
  }
  if (!$isNull(request.healthCheckPath)) {
    query['HealthCheckPath'] = request.healthCheckPath;
  }
  if (!$isNull(request.healthCheckProtocol)) {
    query['HealthCheckProtocol'] = request.healthCheckProtocol;
  }
  if (!$isNull(request.healthCheckTemplateName)) {
    query['HealthCheckTemplateName'] = request.healthCheckTemplateName;
  }
  if (!$isNull(request.healthCheckTimeout)) {
    query['HealthCheckTimeout'] = request.healthCheckTimeout;
  }
  if (!$isNull(request.healthyThreshold)) {
    query['HealthyThreshold'] = request.healthyThreshold;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.unhealthyThreshold)) {
    query['UnhealthyThreshold'] = request.unhealthyThreshold;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateHealthCheckTemplate',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a health check template in a region.
 *
 * @param request CreateHealthCheckTemplateRequest
 * @return CreateHealthCheckTemplateResponse
 */
async function createHealthCheckTemplate(request: CreateHealthCheckTemplateRequest): CreateHealthCheckTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return createHealthCheckTemplateWithOptions(request, runtime);
}

model CreateListenerRequest {
  caCertificates?: [ 
    {
      certificateId?: string(name='CertificateId', description='The ID of the CA certificate.

>  This parameter is required if **CaEnabled** is set to **true**.', example='123157*******'),
    }
  ](name='CaCertificates', description='The certificate authority (CA) certificates. You can specify only one CA certificate.'),
  caEnabled?: boolean(name='CaEnabled', description='Specifies whether to enable mutual authentication. Valid values:

*   **true**: enables mutual authentication.
*   **false** (default): disables mutual authentication.', example='false'),
  certificates?: [ 
    {
      certificateId?: string(name='CertificateId', description='The ID of the certificate. Only server certificates are supported. You can specify up to 20 certificate IDs.', example='103705*******'),
    }
  ](name='Certificates', description='The details about each certificate.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among all requests. The token can contain only ASCII characters.

>  If you do not set this parameter, the system automatically uses the value of **RequestId** as the value of **ClientToken**. **RequestId** may be different for each API request.', example='123e4567-e89b-12d3-a456-426655440000'),
  defaultActions?: [ 
    {
      forwardGroupConfig?: {
        serverGroupTuples?: [ 
          {
            serverGroupId?: string(name='ServerGroupId', description='The ID of the server group to which requests are forwarded.

This parameter is required.', example='sgp-8ilqs4axp6******'),
          }
        ](name='ServerGroupTuples', description='The destination server group to which requests are forwarded.

This parameter is required.'),
      }(name='ForwardGroupConfig', description='The configuration of the forwarding action. You can specify at most 20 actions.

This parameter is required.'),
      type?: string(name='Type', description='The action type. You can specify only one action type. Valid value:

**ForwardGroup**: forwards requests to multiple Server groups.

This parameter is required.', example='ForwardGroup'),
    }
  ](name='DefaultActions', description='The actions of the forwarding rule.

This parameter is required.'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a precheck. Valid values:

*   **true**: prechecks the request without creating a listener. The system checks the required parameters, request syntax, and limits. If the request fails the precheck, an error code is returned based on the cause of the failure. If the request passes the precheck, the `DryRunOperation` error code is returned.
*   **false** (default): sends the API request. If the request passes the precheck, a 2xx HTTP status code is returned and the system proceeds to create a listener.', example='false'),
  gzipEnabled?: boolean(name='GzipEnabled', description='Specifies whether to enable `Gzip` compression to compress specific types of files. Valid values:

*   **true** (default): enables Gzip compression.
*   **false**: disables Gzip compression.', example='true'),
  http2Enabled?: boolean(name='Http2Enabled', description='Specifies whether to enable `HTTP/2`. Valid values:

*   **true** (default): enables HTTP/2.
*   **false**: disables HTTP/2.

>  Only HTTPS listeners support this parameter.', example='true'),
  idleTimeout?: int32(name='IdleTimeout', description='The timeout period of an idle connection. Unit: seconds.

Valid values: **1 to 60**.

Default value: **15**.

If no requests are received within the specified timeout period, ALB closes the current connection. When a new request is received, ALB establishes a new connection.', example='3'),
  listenerDescription?: string(name='ListenerDescription', description='The name of the listener.

The description must be 2 to 256 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_). Regular expressions are supported.', example='HTTP_80'),
  listenerPort?: int32(name='ListenerPort', description='The frontend port that is used by the ALB instance.

Valid values: **1 to 65535**.

This parameter is required.', example='80'),
  listenerProtocol?: string(name='ListenerProtocol', description='The listener protocol.

Valid values: **HTTP**, **HTTPS**, and **QUIC**.

This parameter is required.', example='HTTP'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the ALB instance.

This parameter is required.', example='alb-n5qw04uq8vavfe****'),
  quicConfig?: {
    quicListenerId?: string(name='QuicListenerId', description='The ID of the QUIC listener that you want to associate with the HTTPS listener. Only HTTPS listeners support this parameter. This parameter is required when **QuicUpgradeEnabled** is set to **true**.

>  The HTTPS listener and the QUIC listener must be added to the same ALB instance. Make sure that the QUIC listener is not associated with any other listeners.', example='lsn-o4u54y73wq7b******'),
    quicUpgradeEnabled?: boolean(name='QuicUpgradeEnabled', description='Specifies whether to enable QUIC upgrade. Valid values:

*   **true**: enables QUIC upgrade.
*   **false** (default): disables QUIC upgrade.

>  Only HTTPS listeners support this parameter.', example='false'),
  }(name='QuicConfig', description='Select a QUIC listener and associate it with the ALB instance.'),
  requestTimeout?: int32(name='RequestTimeout', description='The timeout period of a request. Unit: seconds.

Valid values: **1 to 180**.

Default value: **60**.

If no response is received from the backend server during the request timeout period, ALB sends an `HTTP 504` error code to the client.', example='60'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the security policy. System security policies and custom security policies are supported.

Default value: **tls_cipher_policy_1_0** (system security policy).

>  Only HTTPS listeners support this parameter.', example='tls_cipher_policy_1_0'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tag', description='The tags.'),
  XForwardedForConfig?: {
    XForwardedForClientCertClientVerifyAlias?: string(name='XForwardedForClientCertClientVerifyAlias', description='The name of the custom header. This parameter takes effect only when **XForwardedForClientCertClientVerifyEnabled** is set to **true**.

The name must be 1 to 40 characters in length, and can contain lowercase letters, hyphens (-), underscores (_), and digits.

>  Only HTTPS listeners support this parameter.', example='test_client-verify-alias_123456'),
    XForwardedForClientCertClientVerifyEnabled?: boolean(name='XForwardedForClientCertClientVerifyEnabled', description='Specifies whether to use the `X-Forwarded-Clientcert-clientverify` header to retrieve the verification result of the client certificate. Valid values:

*   **true**: uses the X-Forwarded-Clientcert-clientverify header.
*   **false** (default): does not use the X-Forwarded-Clientcert-clientverify header.

>  Only HTTPS listeners support this parameter.', example='true'),
    XForwardedForClientCertFingerprintAlias?: string(name='XForwardedForClientCertFingerprintAlias', description='The name of the custom header. This parameter takes effect only when **XForwardedForClientCertFingerprintEnabled** is set to **true**.

The name must be 1 to 40 characters in length, and can contain lowercase letters, hyphens (-), underscores (_), and digits.

>  Only HTTPS listeners support this parameter.', example='test_finger-print-alias_123456'),
    XForwardedForClientCertFingerprintEnabled?: boolean(name='XForwardedForClientCertFingerprintEnabled', description='Specifies whether to use the `X-Forwarded-Clientcert-fingerprint` header to retrieve the fingerprint of the client certificate. Valid values:

*   **true**: uses the X-Forwarded-Clientcert-fingerprint header.
*   **false** (default): does not use the X-Forwarded-Clientcert-fingerprint header.

>  Only HTTPS listeners support this parameter.', example='true'),
    XForwardedForClientCertIssuerDNAlias?: string(name='XForwardedForClientCertIssuerDNAlias', description='The name of the custom header. This parameter takes effect only when **XForwardedForClientCertIssuerDNEnabled** is set to **true**.

The name must be 1 to 40 characters in length, and can contain lowercase letters, hyphens (-), underscores (_), and digits.

>  Only HTTPS listeners support this parameter.', example='test_issue-dn-alias_123456'),
    XForwardedForClientCertIssuerDNEnabled?: boolean(name='XForwardedForClientCertIssuerDNEnabled', description='Specifies whether to use the `X-Forwarded-Clientcert-issuerdn` header to retrieve information about the authority that issues the client certificate. Valid values:

*   **true**: uses the X-Forwarded-Clientcert-issuerdn header.
*   **false** (default): does not use the X-Forwarded-Clientcert-issuerdn header.

>  Only HTTPS listeners support this parameter.', example='true'),
    XForwardedForClientCertSubjectDNAlias?: string(name='XForwardedForClientCertSubjectDNAlias', description='The name of the custom header. This parameter takes effect only when **XForwardedForClientCertSubjectDNEnabled** is set to **true**.

The name must be 1 to 40 characters in length, and can contain lowercase letters, hyphens (-), underscores (_), and digits.

>  Only HTTPS listeners support this parameter.', example='test_subject-dn-alias_123456'),
    XForwardedForClientCertSubjectDNEnabled?: boolean(name='XForwardedForClientCertSubjectDNEnabled', description='Specifies whether to use the `X-Forwarded-Clientcert-subjectdn` header to retrieve information about the owner of the client certificate. Valid values:

*   **true**: uses the X-Forwarded-Clientcert-subjectdn header.
*   **false** (default): does not use the X-Forwarded-Clientcert-subjectdn header.

>  Only HTTPS listeners support this parameter.', example='true'),
    XForwardedForClientSourceIpsEnabled?: boolean(name='XForwardedForClientSourceIpsEnabled', description='Specifies whether to allow the ALB instance to retrieve client IP addresses from the `X-Forwarded-For` header. Valid values:

*   **true**
*   **false** (default)

>  HTTP and HTTPS listeners support this parameter.', example='false'),
    XForwardedForClientSourceIpsTrusted?: string(name='XForwardedForClientSourceIpsTrusted', description='The trusted proxy IP address.

ALB traverses `X-Forwarded-For` backwards and selects the first IP address that is not in the trusted IP list as the originating IP address of the client, which will be throttled if source IP address throttling is enabled.', example='10.1.1.0/24'),
    XForwardedForClientSrcPortEnabled?: boolean(name='XForwardedForClientSrcPortEnabled', description='Specifies whether to use the `X-Forwarded-Client-srcport` header to retrieve the client port. Valid values:

*   **true**: uses the X-Forwarded-Client-srcport header.
*   **false** (default): does not use the X-Forwarded-Client-srcport header.

>  HTTP and HTTPS listeners support this parameter.', example='true'),
    XForwardedForEnabled?: boolean(name='XForwardedForEnabled', description='Specifies whether to use the `X-Forwarded-For` header to retrieve client IP addresses. Valid values:

*   **true** (default)
*   **false**

>  HTTP and HTTPS listeners support this parameter.', example='true'),
    XForwardedForHostEnabled?: boolean(name='XForwardedForHostEnabled', description='Specifies whether to use the `X-Forwarded-Host` header to retrieve the client domain name. Valid values:

*   **true**
*   **false** (default)

>  This parameter is available for HTTP, HTTPS, and QUIC listeners.', example='false'),
    XForwardedForProcessingMode?: string(name='XForwardedForProcessingMode', description='Specifies how the `X-Forwarded-For` header is processed. This parameter takes effect only when **XForwardedForEnabled** is set to **true**. Valid values:

*   **append** (default)
*   **remove**

> *   If this parameter is set to **append**, ALB appends the IP address of the last hop to the existing `X-Forwarded-For` header in the request before the request is sent to backend servers.
> *   If this parameter is set to **remove**, ALB removes the `X-Forwarded-For` header in the request before the request is sent to backend servers, no matter whether the request carries the `X-Forwarded-For` header.
> *   This parameter is only available for HTTP and HTTPS listeners.', example='append'),
    XForwardedForProtoEnabled?: boolean(name='XForwardedForProtoEnabled', description='Specifies whether to use the `X-Forwarded-Proto` header to retrieve the listener protocol of the ALB instance. Valid values:

*   **true**: uses the X-Forwarded-Proto header.
*   **false** (default): does not use the X-Forwarded-Proto header.

>  HTTP, HTTPS, and QUIC listeners support this parameter.', example='false'),
    XForwardedForSLBIdEnabled?: boolean(name='XForwardedForSLBIdEnabled', description='Specifies whether to use the `SLB-ID` header to retrieve the ID of the ALB instance. Valid values:

*   **true**: uses the SLB-ID header.
*   **false** (default): does not use the SLB-ID header.

>  HTTP, HTTPS, and QUIC listeners support this parameter.', example='false'),
    XForwardedForSLBPortEnabled?: boolean(name='XForwardedForSLBPortEnabled', description='Specifies whether to use the `X-Forwarded-Port` header to retrieve the listener port of the ALB instance. Valid values:

*   **true**: uses the X-Forwarded-Port header.
*   **false** (default): does not use the X-Forwarded-Port header.

>  HTTP, HTTPS, and QUIC listeners support this parameter.', example='false'),
  }(name='XForwardedForConfig', description='The configuration of the XForward header.'),
}

model CreateListenerResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsn-o4u54y73wq7b******'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876*******'),
}

model CreateListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateListenerResponseBody(name='body'),
}

/**
 * @summary Creates a listener.
 *
 * @description ## Usage notes
 * **CreateListener** is an asynchronous operation. After you call this operation, the system returns a request ID. However, the operation is still being performed in the background. You can call the [GetListenerAttribute](https://help.aliyun.com/document_detail/214353.html) operation to query the status of the HTTP, HTTPS, or QUIC listener.
 * *   If the HTTP, HTTPS, or QUIC listener is in the **Provisioning** state, it indicates that the listener is being created.
 * *   If the HTTP, HTTPS, or QUIC listener is in the **Running** state, it indicates that the listener has been created successfully.
 *
 * @param request CreateListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateListenerResponse
 */
async function createListenerWithOptions(request: CreateListenerRequest, runtime: $RuntimeOptions): CreateListenerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.caCertificates)) {
    query['CaCertificates'] = request.caCertificates;
  }
  if (!$isNull(request.caEnabled)) {
    query['CaEnabled'] = request.caEnabled;
  }
  if (!$isNull(request.certificates)) {
    query['Certificates'] = request.certificates;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.defaultActions)) {
    query['DefaultActions'] = request.defaultActions;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.gzipEnabled)) {
    query['GzipEnabled'] = request.gzipEnabled;
  }
  if (!$isNull(request.http2Enabled)) {
    query['Http2Enabled'] = request.http2Enabled;
  }
  if (!$isNull(request.idleTimeout)) {
    query['IdleTimeout'] = request.idleTimeout;
  }
  if (!$isNull(request.listenerDescription)) {
    query['ListenerDescription'] = request.listenerDescription;
  }
  if (!$isNull(request.listenerPort)) {
    query['ListenerPort'] = request.listenerPort;
  }
  if (!$isNull(request.listenerProtocol)) {
    query['ListenerProtocol'] = request.listenerProtocol;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.quicConfig)) {
    query['QuicConfig'] = request.quicConfig;
  }
  if (!$isNull(request.requestTimeout)) {
    query['RequestTimeout'] = request.requestTimeout;
  }
  if (!$isNull(request.securityPolicyId)) {
    query['SecurityPolicyId'] = request.securityPolicyId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.XForwardedForConfig)) {
    query['XForwardedForConfig'] = request.XForwardedForConfig;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateListener',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a listener.
 *
 * @description ## Usage notes
 * **CreateListener** is an asynchronous operation. After you call this operation, the system returns a request ID. However, the operation is still being performed in the background. You can call the [GetListenerAttribute](https://help.aliyun.com/document_detail/214353.html) operation to query the status of the HTTP, HTTPS, or QUIC listener.
 * *   If the HTTP, HTTPS, or QUIC listener is in the **Provisioning** state, it indicates that the listener is being created.
 * *   If the HTTP, HTTPS, or QUIC listener is in the **Running** state, it indicates that the listener has been created successfully.
 *
 * @param request CreateListenerRequest
 * @return CreateListenerResponse
 */
async function createListener(request: CreateListenerRequest): CreateListenerResponse {
  var runtime = new $RuntimeOptions{};
  return createListenerWithOptions(request, runtime);
}

model CreateLoadBalancerRequest {
  addressAllocatedMode?: string(name='AddressAllocatedMode', description='The mode in which IP addresses are allocated. Default value: Dynamic. Valid values:

*   **Fixed**: The ALB instance uses a static IP address.
*   **Dynamic** (default): The system dynamically allocates an IP address to each zone of the ALB instance.', example='Dynamic'),
  addressIpVersion?: string(name='AddressIpVersion', description='The protocol version. Valid values:

*   **IPv4:** IPv4.
*   **DualStack:** dual stack.', example='IPv4'),
  addressType?: string(name='AddressType', description='The type of the address of the ALB instance. Valid values:

*   **Internet:** The ALB instance uses a public IP address. The domain name of the ALB instance is resolved to the public IP address. In this case, the ALB instance can be accessed over the Internet.
*   **Intranet:** The ALB instance uses a private IP address. The domain name of the ALB instance is resolved to the private IP address. In this case, the ALB instance can be accessed over the VPC in which the ALB instance is deployed.

This parameter is required.', example='Internet'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters.

>  If you do not specify this parameter, the system uses the value of **RequestId** as the value of **ClientToken**. The value of the **RequestId** parameter may be different for each API request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  deletionProtectionEnabled?: boolean(name='DeletionProtectionEnabled', description='Specifies whether to enable deletion protection. Default value: false. Valid values:

*   **true:** enables deletion protection.
*   **false:** disables deletion protection.', example='false'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Default value: false. Valid values:

*   **true:** performs a dry run. The system checks the required parameters, request format, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false:** performs a dry run and sends the request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerBillingConfig?: {
    bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the Internet Shared Bandwidth instance that is associated with the Internet-facing ALB instance.', example='cbwp-bp1vevu8h3ieh****'),
    payType?: string(name='PayType', description='The billing method of the ALB instance.

Set the value to **PostPay**, which specifies the pay-as-you-go billing method.

This parameter is required.', example='PostPay'),
  }(name='LoadBalancerBillingConfig', description='The billing method of the ALB instance.

This parameter is required.'),
  loadBalancerEdition?: string(name='LoadBalancerEdition', description='The edition of the ALB instance. The features and billing rules vary based on the edition of the ALB instance. Valid values:

*   **Basic:** basic.
*   **Standard:** standard.
*   **StandardWithWaf:** WAF-enabled.

This parameter is required.', example='Standard'),
  loadBalancerName?: string(name='LoadBalancerName', description='The name of the ALB instance.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='alb1'),
  modificationProtectionConfig?: {
    reason?: string(name='Reason', description='The reason for enabling the configuration read-only mode. The reason must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The reason must start with a letter.

> This parameter takes effect only if `Status` is set to **ConsoleProtection**.', example='test'),
    status?: string(name='Status', description='Specifies whether to enable the configuration read-only mode. Valid values:

*   **NonProtection**: disables the configuration read-only mode. In this case, you cannot specify ModificationProtectionReason. If you specify ModificationProtectionReason, the value of the parameter is cleared.
*   **ConsoleProtection**: enables the configuration read-only mode. In this case, you can specify ModificationProtectionReason.

> If you set this parameter to **ConsoleProtection**, you cannot use the ALB console to modify instance configurations. However, you can call API operations to modify instance configurations.', example='ConsoleProtection'),
  }(name='ModificationProtectionConfig', description='The configuration of the configuration read-only mode.'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-atstuj3rtop****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key can be up to 128 characters in length, and cannot start with acs: or aliyun. It cannot contain http:// or https://.', example='env'),
      value?: string(name='Value', description='The tag value can be up to 128 characters in length, and cannot start with acs: or aliyun. It cannot contain http:// or https://.', example='product'),
    }
  ](name='Tag', description='The tags.'),
  vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC) in which you want to create the ALB instance.

This parameter is required.', example='vpc-bp1b49rqrybk45nio****'),
  zoneMappings?: [ 
    {
      allocationId?: string(name='AllocationId', description='The ID of the EIP to be associated with the Internet-facing ALB instance.', example='eip-bp1aedxso6u80u0qf****'),
      eipType?: string(name='EipType', description='The type of EIP. Valid values:

*   **Common**: an EIP.
*   **Anycast**: an Anycast EIP.

>  For more information about the regions in which ALB supports Anycast EIPs, see [Limits](https://help.aliyun.com/document_detail/460727.html).', example='Common'),
      intranetAddress?: string(name='IntranetAddress', description='The private IPv4 address.', example='192.168.10.1'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch in the zone. You can specify only one vSwitch (subnet) in each zone. You can specify at most 10 zones. If the region supports two or more zones, specify at least two zones.

This parameter is required.', example='vsw-sersdf****'),
      zoneId?: string(name='ZoneId', description='The zone ID of the cluster. You can specify at most 10 zones. If the region supports two or more zones, specify at least two zones. You can call the [DescribeZones](https://help.aliyun.com/document_detail/36064.html) operation to query the most recent zone list.

This parameter is required.', example='cn-hangzhou-a'),
    }
  ](name='ZoneMappings', description='The mappings between zones an vSwitches. You can specify at most 10 zones. If the selected region supports two or more zones, select at least two zones to ensure the high availability of your service.

This parameter is required.'),
}

model CreateLoadBalancerResponseBody = {
  loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.', example='alb-o9ulmq5hgn68jk****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model CreateLoadBalancerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateLoadBalancerResponseBody(name='body'),
}

/**
 * @summary Creates an Application Load Balancer (ALB) instance in a region.
 *
 * @description **CreateLoadBalancer** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the status of an ALB instance.
 * *   If an ALB instance is in the **Provisioning** state, it indicates that the ALB instance is being created.
 * *   If an ALB instance is in the **Active** state, it indicates that the ALB instance is created.
 *
 * @param request CreateLoadBalancerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateLoadBalancerResponse
 */
async function createLoadBalancerWithOptions(request: CreateLoadBalancerRequest, runtime: $RuntimeOptions): CreateLoadBalancerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.addressAllocatedMode)) {
    query['AddressAllocatedMode'] = request.addressAllocatedMode;
  }
  if (!$isNull(request.addressIpVersion)) {
    query['AddressIpVersion'] = request.addressIpVersion;
  }
  if (!$isNull(request.addressType)) {
    query['AddressType'] = request.addressType;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.deletionProtectionEnabled)) {
    query['DeletionProtectionEnabled'] = request.deletionProtectionEnabled;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerBillingConfig)) {
    query['LoadBalancerBillingConfig'] = request.loadBalancerBillingConfig;
  }
  if (!$isNull(request.loadBalancerEdition)) {
    query['LoadBalancerEdition'] = request.loadBalancerEdition;
  }
  if (!$isNull(request.loadBalancerName)) {
    query['LoadBalancerName'] = request.loadBalancerName;
  }
  if (!$isNull(request.modificationProtectionConfig)) {
    query['ModificationProtectionConfig'] = request.modificationProtectionConfig;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!$isNull(request.zoneMappings)) {
    query['ZoneMappings'] = request.zoneMappings;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateLoadBalancer',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates an Application Load Balancer (ALB) instance in a region.
 *
 * @description **CreateLoadBalancer** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the status of an ALB instance.
 * *   If an ALB instance is in the **Provisioning** state, it indicates that the ALB instance is being created.
 * *   If an ALB instance is in the **Active** state, it indicates that the ALB instance is created.
 *
 * @param request CreateLoadBalancerRequest
 * @return CreateLoadBalancerResponse
 */
async function createLoadBalancer(request: CreateLoadBalancerRequest): CreateLoadBalancerResponse {
  var runtime = new $RuntimeOptions{};
  return createLoadBalancerWithOptions(request, runtime);
}

model CreateRuleRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  direction?: string(name='Direction', description='The direction to which the forwarding rule is applied. Valid values:

*   **Request** (default): The forwarding rule is applied to the requests received by ALB.
*   **Response**: The forwarding rule is applied to the responses returned by backend servers.

> Basic ALB instances do not support the **Response** value.', example='Request'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='false'),
  listenerId?: string(name='ListenerId', description='The listener ID of the ALB instance.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  priority?: int32(name='Priority', description='The priority of the forwarding rule. Valid values: **1 to 10000**. A smaller value indicates a higher priority.

> The priorities of the forwarding rules created for the same listener must be unique.

This parameter is required.', example='10'),
  ruleActions?: [ 
    {
      corsConfig?: {
        allowCredentials?: string(name='AllowCredentials', description='Specifies whether to allow credentials to be carried in CORS requests. Valid values:

*   **on**: allows credentials to be carried in CORS requests.
*   **off**: does not allow credentials to be carried in CORS requests.', example='on'),
        allowHeaders?: [ string ](name='AllowHeaders', description='The trusted headers of CORS requests.'),
        allowMethods?: [ string ](name='AllowMethods', description='The trusted HTTP methods of CORS requests.'),
        allowOrigin?: [ string ](name='AllowOrigin', description='The trusted origins of CORS requests. You can specify one or more values, or only the wildcard character (`*`).

*   Each value must start with `http://` or `https://`, which must be followed by a valid domain name, including top-level domain names. Example: `http://*.test.abc.example.com`.
*   You can specify a port in each value or leave the port empty. Valid values: **1** to **65535**.'),
        exposeHeaders?: [ string ](name='ExposeHeaders', description='The headers that can be exposed.'),
        maxAge?: long(name='MaxAge', description='The maximum cache time of dry run requests in the browser. Unit: seconds.

Valid values: **-1** to **172800**.', example='1000'),
      }(name='CorsConfig', description='Request forwarding based on CORS.'),
      fixedResponseConfig?: {
        content?: string(name='Content', description='The content of the custom response. The content cannot exceed 1 KB in size, and can contain only ASCII characters.', example='dssacav'),
        contentType?: string(name='ContentType', description='The format of the response.

Valid values: **text/plain**, **text/css**, **text/html**, **application/javascript**, and **application/json**.', example='text/plain'),
        httpCode?: string(name='HttpCode', description='The HTTP status code in responses. Valid values: **2xx**, **4xx**, **5xx**. The value must be a numeric string. **x** must be a digit.', example='HTTP_200'),
      }(name='FixedResponseConfig', description='The configuration of the custom response.'),
      forwardGroupConfig?: {
        serverGroupStickySession?: {
          enabled?: boolean(name='Enabled', description='Specifies whether to enable session persistence. Valid values:

*   **true**: enables session persistence.
*   **false** (default): disables session persistence.', example='false'),
          timeout?: int32(name='Timeout', description='The timeout period of sessions. Unit: seconds Valid values: **1** to **86400**. Default value: **1000**.', example='100'),
        }(name='ServerGroupStickySession', description='The configuration of session persistence for the server groups.'),
        serverGroupTuples?: [ 
          {
            serverGroupId?: string(name='ServerGroupId', description='The server group to which requests are forwarded.', example='sgp-k86c1ov501id6p****'),
            weight?: int32(name='Weight', description='The weight of the server group. A larger value specifies a higher weight. A server group with a higher weight receives more requests. Valid values: **0** to **100**.

*   If the number of destination server groups is 1, the default weight of the server group is **100**, unless you specify a weight.
*   If the number of destination server groups is larger than 1, you must specify a weight.', example='100'),
          }
        ](name='ServerGroupTuples', description='The server groups to which requests are forwarded. You can specify at most five server groups for each forwarding rule.'),
      }(name='ForwardGroupConfig', description='The server groups to which requests are forwarded. You can specify at most five server groups for each forwarding rule.'),
      insertHeaderConfig?: {
        key?: string(name='Key', description='The key of the header. The header key must be 1 to 40 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The header keys specified by **InsertHeaderConfig** must be unique.

>  You cannot specify the following header keys: `slb-id`, `slb-ip`, `x-forwarded-for`, `x-forwarded-proto`, `x-forwarded-eip`, `x-forwarded-port`, `x-forwarded-client-srcport`, `connection`, `upgrade`, `content-length`, `transfer-encoding`, `keep-alive`, `te`, `host`, `cookie`, `remoteip`, and `authority`. The header keys are not case-sensitive.', example='key'),
        value?: string(name='Value', description='The value of the header to be inserted.

*   If **ValueType** is set to **SystemDefined**, you can set the Value parameter to one of the following values:

    *   **ClientSrcPort**: the client port.
    *   **ClientSrcIp**: the IP address of the client.
    *   **Protocol**: the request protocol (HTTP or HTTPS).
    *   **SLBId**: the ID of the ALB instance.
    *   **SLBPort**: the listener port.

*   If **ValueType** is set to **UserDefined**, you can specify a custom header value. The header value must be 1 to 128 characters in length, and can contain wildcard characters, such as asterisks (\\\\*) and question marks (?), and printable characters whose ASCII values are `larger than or equal to 32 and smaller than 127`. The header value cannot start or end with a space character.

*   If **ValueType** is set to **ReferenceHeader**, you can reference a value from request headers. The value must be 1 to 128 characters in length, and can contain lowercase letters, digits, hyphens (-), and underscores (_).', example='UserDefined'),
        valueType?: string(name='ValueType', description='The type of header. Valid values:

*   **UserDefined**: a custom header value.
*   **ReferenceHeader**: a header value that is referenced from one of the request headers.
*   **SystemDefined**: a header predefined by the system.', example='UserDefined'),
      }(name='InsertHeaderConfig', description='The key of the header to be inserted.'),
      order?: int32(name='Order', description='The priority of the action. Valid values: **1 to 50000**. A smaller value indicates a higher priority. The actions of a forwarding rule are applied in descending order of priority. This parameter cannot empty. The priority of each action within a forwarding rule must be unique.

This parameter is required.', example='1'),
      redirectConfig?: {
        host?: string(name='Host', description='The hostname to which requests are forwarded. Valid values:

*   **${host}** (default): If you set the value to ${host}, you cannot append other characters.

*   If you want to specify a custom value, make sure that the following requirements are met:

    *   The hostname must be 3 to 128 characters in length, and can contain lowercase letters, digits, and the following characters: - . \\\\* = ~ _ + \\\\ ^ ! $ & | ( ) [ ] ?.
    *   The hostname must contain at least one period (.) but cannot start or end with a period (.).
    *   The rightmost domain label can contain only letters and wildcard characters, and cannot contain digits or hyphens (-). The leftmost `domain label` can be an asterisk (\\\\*).
    *   The domain labels cannot start or end with hyphens (-).
    *   You can use asterisks (\\\\*) and question marks (?) anywhere in a domain label as wildcard characters.', example='${host}'),
        httpCode?: string(name='HttpCode', description='The HTTP status code that indicates the redirect type. Valid values: **301**, **302**, **303**, **307**, and **308**.', example='301'),
        path?: string(name='Path', description='The URL to which requests are redirected. Valid values:

*   Default value: **${path}**. **${host}**, **${protocol}**, and **${port}** are also supported. Each variable can be specified only once. You can specify one or more of the preceding variables in each request. You can also combine them with a custom value.

*   If you want to specify a custom value, make sure that the following requirements are met:

    *   The UTRL must be 1 to 128 characters in length, and is case-sensitive. You can use asterisks (\\\\*) and question marks (?) as wildcard characters.
    *   The URL must start with a forward slash (/) and can contain letters, digits, and the following special characters: `$ - _ .+ / & ~ @ :`. It cannot contain the following special characters: `" % # ; ! ( ) [ ] ^ , "`. You can use asterisks (\\\\*) and question marks (?) as wildcard characters.', example='/test'),
        port?: string(name='Port', description='The port to which requests are distributed.

*   **${port}** (default): If you set the value to ${port}, you cannot append other characters to the value.
*   You can also enter a port number. Valid values: **1 to 63335**.', example='10'),
        protocol?: string(name='Protocol', description='The redirect protocol. Valid values: Valid values:

*   **${protocol}** (default): If you set the value to ${protocol}, you cannot modify the value or append other characters.
*   **HTTP**
*   **HTTPS**

> 

*   HTTPS listeners support only HTTPS redirection.

*   HTTP listeners support HTTP and HTTPS redirection.', example='HTTP'),
        query?: string(name='Query', description='The query string to which requests are redirected.

*   Default value: **${query}**. **${host}**, **${protocol}**, and **${port}** are also supported. Each variable can be specified only once. The preceding variables can be used at the same time or combined with a custom value.

*   If you want to specify a custom value, make sure that the following requirements are met:

    *   The query string must be 1 to 128 characters in length.
    *   It can contain printable characters, but cannot contain space characters, the special characters `# [ ] { } \\\\ | < > &`, or lowercase letters.', example='${query}'),
      }(name='RedirectConfig', description='The configuration of the redirect action.

>  Do not set all fields in **RedirectConfig** to default values, except for **httpCode**.'),
      removeHeaderConfig?: {
        key?: string(name='Key', description='The key of the header to be removed. The header key must be 1 to 40 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The header keys specified in RemoveHeader must be unique.

*   If Direction is set to Requests, the following header keys are not supported: `slb-id`, `slb-ip`, `x-forwarded-for`, `x-forwarded-proto`, `x-forwarded-eip`, `x-forwarded-port`, `x-forwarded-client-srcport`, `connection`, `upgrade`, `content-length`, `transfer-encoding`, `keep-alive`, `te`, `host`, `cookie`, `remoteip`, and `authority`. The header keys are not case-sensitive.
*   If Direction is set to Response, the following response header keys are not supported: `connection`, `upgrade`, `content-length`, and `transfer-encoding`. The header keys are not case-sensitive.', example='test'),
      }(name='RemoveHeaderConfig', description='The HTTP header to be removed.'),
      rewriteConfig?: {
        host?: string(name='Host', description='The hostname to which requests are redirected. Valid values:

*   **${host}** (default): If you set the value to ${host}, you cannot append other characters.

*   If you want to specify a custom value, make sure that the following requirements are met:

    *   The hostname must be 3 to 128 characters in length, and can contain lowercase letters, digits, and the following characters: - . \\\\* = ~ _ + \\\\ ^ ! $ & | ( ) [ ] ?.
    *   The hostname must contain at least one period (.) but cannot start or end with a period (.).
    *   The rightmost domain label can contain only letters and wildcard characters, and cannot contain digits or hyphens (-). The leftmost `domain label` can be an asterisk (\\\\*).
    *   The domain labels cannot start or end with hyphens (-). You can use asterisks (\\\\*) and question marks (?) anywhere in a domain label as wildcard characters.', example='www.example.com'),
        path?: string(name='Path', description='The URL to which requests are redirected. Valid values:

*   Default value: **${path}**. **${host}**, **${protocol}**, and **${port}** are also supported. Each variable can be specified only once. You can specify one or more of the preceding variables in each request. You can also combine them with a custom value.

*   If you want to specify a custom value, make sure that the following requirements are met:

    *   The UTRL must be 1 to 128 characters in length, and is case-sensitive. You can use asterisks (\\\\*) and question marks (?) as wildcard characters.
    *   The URL must start with a forward slash (/) and can contain letters, digits, and the following special characters: `$ - _ .+ / & ~ @ :`. It cannot contain the following special characters: `" % # ; ! ( ) [ ] ^ , "`. You can use asterisks (\\\\*) and question marks (?) as wildcard characters.', example='/tsdf'),
        query?: string(name='Query', description='The query string of the URL to which requests are distributed.

*   Default value: **${query}**. **${host}**, **${protocol}**, and **${port}** are also supported. Each variable can be specified only once. The preceding variables can be used at the same time or combined with a custom value.

*   If you want to specify a custom value, make sure that the following requirements are met:

    *   The query string must be 1 to 128 characters in length.
    *   It can contain printable characters, but cannot contain space characters, the special characters `# [ ] { } \\\\ | < > &`, or lowercase letters.', example='${query}'),
      }(name='RewriteConfig', description='The configuration of the rewrite action.

>  If you specify multiple actions for a forwarding rule, you must configure the **ForwardGroup** parameter for the **RewriteConfig** action.'),
      trafficLimitConfig?: {
        perIpQps?: int32(name='PerIpQps', description='The number of requests per IP address. Value values: **1 to 1000000**.

>  If both the **QPS** and **PerIpQps** parameters are specified, the value of the **QPS** parameter is smaller than the value of the PerIpQps parameter.', example='80'),
        QPS?: int32(name='QPS', description='The number of queries per second (QPS). Valid values: **1 to 1000000**.', example='100'),
      }(name='TrafficLimitConfig', description='The configuration of the traffic throttling action.'),
      trafficMirrorConfig?: {
        mirrorGroupConfig?: {
          serverGroupTuples?: [ 
            {
              serverGroupId?: string(name='ServerGroupId', description='The ID of the VServer group.', example='sgp-00mkgijak0w4qgz9****'),
            }
          ](name='ServerGroupTuples', description='The server group to which traffic is mirrored.'),
        }(name='MirrorGroupConfig', description='The configuration of the server group to which traffic is mirrored.'),
        targetType?: string(name='TargetType', description='The type of target to which network traffic is mirrored. Valid values:

*   **ForwardGroupMirror**: a server group.', example='ForwardGroupMirror'),
      }(name='TrafficMirrorConfig', description='The configuration of the traffic mirroring action.'),
      type?: string(name='Type', description='The action. Valid values:

*   **ForwardGroup**: distributes requests to multiple vServer groups.
*   **Redirect**: redirects a request.
*   **FixedResponse**: returns a custom response.
*   **Rewrite**: rewrites a request.
*   **InsertHeader**: inserts headers.
*   **RemoveHeaderConfig:** deletes the header of a request.
*   **TrafficLimit**: throttles traffic.
*   **TrafficMirror**: mirrors network traffic.
*   **Cors**: enables cross-origin resource sharing (CORS).

The following action types are supported:

*   **FinalType**: Each forwarding rule can contain only one FinalType action, which is performed at the end. You can specify only one of **ForwardGroup**, **Redirect**, and **FixedResponse**.
*   **ExtType**: Each forwarding rule can contain one or more **ExtType** actions, which are performed before the **FinalType** action. If you want to specify an ExtType action, you must also specify a **FinalType** action. You can specify multiple **InsertHeader** actions or one **Rewrite** action.

This parameter is required.', example='ForwardGroup'),
    }
  ](name='RuleActions', description='The actions of the forwarding rule.

This parameter is required.'),
  ruleConditions?: [ 
    {
      cookieConfig?: {
        values?: [ 
          {
            key?: string(name='Key', description='The cookie key.

*   The cookie key must be 1 to 100 characters in length.
*   You can use asterisks (\\\\*) and question marks (?) as wildcard characters.
*   The cookie key can contain printable characters, but cannot contain uppercase letters, space characters, or the following special characters: `; # [ ] { } \\\\ | < > &`.', example='test'),
            value?: string(name='Value', description='The cookie value.

*   The cookie value must be 1 to 100 characters in length.
*   You can use asterisks (\\\\*) and question marks (?) as wildcard characters.
*   The cookie value can contain printable characters, but cannot contain uppercase letters, space characters, or the following special characters: `; # [ ] { } \\\\ | < > &`.', example='test'),
          }
        ](name='Values', description='The cookie values.'),
      }(name='CookieConfig', description='The key-value pairs of the cookie.'),
      headerConfig?: {
        key?: string(name='Key', description='The header key.

*   The header key must be 1 to 40 characters in length.
*   The key can contain letters, digits, hyphens (-), and underscores (_).
*   Cookie and Host are not supported.', example='Port'),
        values?: [ string ](name='Values', description='The header values.'),
      }(name='HeaderConfig', description='The configuration of the header.'),
      hostConfig?: {
        values?: [ string ](name='Values', description='The hostnames.'),
      }(name='HostConfig', description='The configuration of the host.'),
      methodConfig?: {
        values?: [ string ](name='Values', description='The request methods.'),
      }(name='MethodConfig', description='The configurations of the request method.'),
      pathConfig?: {
        values?: [ string ](name='Values', description='The forwarding URLs.'),
      }(name='PathConfig', description='The configurations of the URL to which requests are forwarded.'),
      queryStringConfig?: {
        values?: [ 
          {
            key?: string(name='Key', description='They key of the query string.

*   The key must be 1 to 100 characters in length.
*   You can use asterisks (\\\\*) and question marks (?) as wildcard characters. The key can contain printable characters, excluding uppercase letters, space characters, and the following special characters: `# [ ] { } \\\\ | < > &`.', example='test'),
            value?: string(name='Value', description='The value of the query string.

*   The query string must be 1 to 128 characters in length.
*   The value can contain printable characters, excluding uppercase letters, space characters, and the following special characters: `# [ ] { } \\\\ | < > &`. You can use asterisks (\\\\*) and question marks (?) as wildcard characters.', example='test'),
          }
        ](name='Values', description='The query strings.'),
      }(name='QueryStringConfig', description='The configurations of the query strings.'),
      responseHeaderConfig?: {
        key?: string(name='Key', description='The key of the header.

*   The key must be 1 to 40 characters in length,
*   The key can contain letters, digits, hyphens (-), and underscores (_).
*   Cookie and Host are not supported.', example='test'),
        values?: [ string ](name='Values', description='The header values.'),
      }(name='ResponseHeaderConfig', description='The configuration of headers.'),
      responseStatusCodeConfig?: {
        values?: [ string ](name='Values', description='The response status codes.'),
      }(name='ResponseStatusCodeConfig', description='The configurations of the response status codes.'),
      sourceIpConfig?: {
        values?: [ string ](name='Values', description='The source IP addresses used for traffic matching.'),
      }(name='SourceIpConfig', description='Configurations of traffic matching based on source IP addresses. This parameter is required and valid when **Type** is set to **SourceIP**.'),
      type?: string(name='Type', description='The type of forwarding rule. Valid values:

*   **Host**: Requests are distributed based on hosts.
*   **Path**: Requests are distributed based on paths.
*   **Header**: Requests are forwarded based on HTTP headers.
*   **QueryString**: Requests are distributed based on query strings.
*   **Method**: Requests are distributed based on request methods.
*   **Cookie**: Requests are distributed based on cookies.
*   **SourceIp**: Requests are forwarded based on source IP addresses.
*   **ResponseHeader**: Requests are forwarded based on HTTP response headers.
*   **ResponseStatusCode**: Requests are forwarded based on response status codes.

This parameter is required.', example='Host'),
    }
  ](name='RuleConditions', description='The match conditions of the forwarding rule.

This parameter is required.'),
  ruleName?: string(name='RuleName', description='The name of the forwarding rule.

*   The name must be 2 to 128 characters in length.
*   It can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

This parameter is required.', example='rule-doc'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.', example='env'),
      value?: string(name='Value', description='The tag value can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.', example='product'),
    }
  ](name='Tag', description='The tags.'),
}

model CreateRuleResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540750'),
  ruleId?: string(name='RuleId', description='The forwarding rule ID.', example='rule-a3x3pg1yohq3lq****'),
}

model CreateRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRuleResponseBody(name='body'),
}

/**
 * @summary Creates a forwarding rule for a listener.
 *
 * @description Take note of the following limits:
 * *   When you configure the **Redirect** action, you can use the default value only for the **HttpCode** parameter. Do not use the default values for the other parameters.
 * *   If you specify the **Rewrite** action together with other actions in a forwarding rule, make sure that the **ForwardGroup** action is specified.
 * *   **CreateRule** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListRules](https://help.aliyun.com/document_detail/214379.html) operation to query the status of a forwarding rule.
 *     *   If a forwarding rule is in the **Provisioning** state, the forwarding rule is being created.
 *     *   If a forwarding rule is in the **Available** state, the forwarding rule is created.
 * *   You can set **RuleConditions** and **RuleActions** to add conditions and actions to a forwarding rule. The limits on conditions and actions are:
 *     *   Limits on conditions: 5 for a basic Application Load Balancer (ALB) instance, 10 for a standard ALB instance, and 10 for a WAF-enabled ALB instance.
 *     *   Limits on actions: 3 for a basic ALB instance, 5 for a standard ALB instance, and 5 for a WAF-enabled ALB instance.
 *
 * @param request CreateRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRuleResponse
 */
async function createRuleWithOptions(request: CreateRuleRequest, runtime: $RuntimeOptions): CreateRuleResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.direction)) {
    query['Direction'] = request.direction;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!$isNull(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!$isNull(request.ruleActions)) {
    query['RuleActions'] = request.ruleActions;
  }
  if (!$isNull(request.ruleConditions)) {
    query['RuleConditions'] = request.ruleConditions;
  }
  if (!$isNull(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateRule',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a forwarding rule for a listener.
 *
 * @description Take note of the following limits:
 * *   When you configure the **Redirect** action, you can use the default value only for the **HttpCode** parameter. Do not use the default values for the other parameters.
 * *   If you specify the **Rewrite** action together with other actions in a forwarding rule, make sure that the **ForwardGroup** action is specified.
 * *   **CreateRule** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListRules](https://help.aliyun.com/document_detail/214379.html) operation to query the status of a forwarding rule.
 *     *   If a forwarding rule is in the **Provisioning** state, the forwarding rule is being created.
 *     *   If a forwarding rule is in the **Available** state, the forwarding rule is created.
 * *   You can set **RuleConditions** and **RuleActions** to add conditions and actions to a forwarding rule. The limits on conditions and actions are:
 *     *   Limits on conditions: 5 for a basic Application Load Balancer (ALB) instance, 10 for a standard ALB instance, and 10 for a WAF-enabled ALB instance.
 *     *   Limits on actions: 3 for a basic ALB instance, 5 for a standard ALB instance, and 5 for a WAF-enabled ALB instance.
 *
 * @param request CreateRuleRequest
 * @return CreateRuleResponse
 */
async function createRule(request: CreateRuleRequest): CreateRuleResponse {
  var runtime = new $RuntimeOptions{};
  return createRuleWithOptions(request, runtime);
}

model CreateRulesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='false'),
  listenerId?: string(name='ListenerId', description='The ID of the Application Load Balancer (ALB) instance.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  rules?: [ 
    {
      direction?: string(name='Direction'),
      priority?: int32(name='Priority', description='This parameter is required.'),
      ruleActions?: [ 
        {
          corsConfig?: {
            allowCredentials?: string(name='AllowCredentials'),
            allowHeaders?: [ string ](name='AllowHeaders'),
            allowMethods?: [ string ](name='AllowMethods'),
            allowOrigin?: [ string ](name='AllowOrigin'),
            exposeHeaders?: [ string ](name='ExposeHeaders'),
            maxAge?: long(name='MaxAge'),
          }(name='CorsConfig'),
          fixedResponseConfig?: {
            content?: string(name='Content'),
            contentType?: string(name='ContentType'),
            httpCode?: string(name='HttpCode'),
          }(name='FixedResponseConfig'),
          forwardGroupConfig?: {
            serverGroupStickySession?: {
              enabled?: boolean(name='Enabled'),
              timeout?: int32(name='Timeout'),
            }(name='ServerGroupStickySession'),
            serverGroupTuples?: [ 
              {
                serverGroupId?: string(name='ServerGroupId'),
                weight?: int32(name='Weight'),
              }
            ](name='ServerGroupTuples'),
          }(name='ForwardGroupConfig'),
          insertHeaderConfig?: {
            key?: string(name='Key'),
            value?: string(name='Value'),
            valueType?: string(name='ValueType'),
          }(name='InsertHeaderConfig'),
          order?: int32(name='Order', description='This parameter is required.'),
          redirectConfig?: {
            host?: string(name='Host'),
            httpCode?: string(name='HttpCode'),
            path?: string(name='Path'),
            port?: string(name='Port'),
            protocol?: string(name='Protocol'),
            query?: string(name='Query'),
          }(name='RedirectConfig'),
          removeHeaderConfig?: {
            key?: string(name='Key'),
          }(name='RemoveHeaderConfig'),
          rewriteConfig?: {
            host?: string(name='Host'),
            path?: string(name='Path'),
            query?: string(name='Query'),
          }(name='RewriteConfig'),
          trafficLimitConfig?: {
            perIpQps?: int32(name='PerIpQps'),
            QPS?: int32(name='QPS'),
          }(name='TrafficLimitConfig'),
          trafficMirrorConfig?: {
            mirrorGroupConfig?: {
              serverGroupTuples?: [ 
                {
                  serverGroupId?: string(name='ServerGroupId'),
                }
              ](name='ServerGroupTuples'),
            }(name='MirrorGroupConfig'),
            targetType?: string(name='TargetType'),
          }(name='TrafficMirrorConfig'),
          type?: string(name='Type', description='This parameter is required.'),
        }
      ](name='RuleActions', description='This parameter is required.'),
      ruleConditions?: [ 
        {
          cookieConfig?: {
            values?: [ 
              {
                key?: string(name='Key'),
                value?: string(name='Value'),
              }
            ](name='Values'),
          }(name='CookieConfig'),
          headerConfig?: {
            key?: string(name='Key'),
            values?: [ string ](name='Values'),
          }(name='HeaderConfig'),
          hostConfig?: {
            values?: [ string ](name='Values'),
          }(name='HostConfig'),
          methodConfig?: {
            values?: [ string ](name='Values'),
          }(name='MethodConfig'),
          pathConfig?: {
            values?: [ string ](name='Values'),
          }(name='PathConfig'),
          queryStringConfig?: {
            values?: [ 
              {
                key?: string(name='Key'),
                value?: string(name='Value'),
              }
            ](name='Values'),
          }(name='QueryStringConfig'),
          responseHeaderConfig?: {
            key?: string(name='Key'),
            values?: [ string ](name='Values'),
          }(name='ResponseHeaderConfig'),
          responseStatusCodeConfig?: {
            values?: [ string ](name='Values'),
          }(name='ResponseStatusCodeConfig'),
          sourceIpConfig?: {
            values?: [ string ](name='Values'),
          }(name='SourceIpConfig'),
          type?: string(name='Type', description='This parameter is required.'),
        }
      ](name='RuleConditions', description='This parameter is required.'),
      ruleName?: string(name='RuleName', description='This parameter is required.'),
      tag?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tag'),
    }
  ](name='Rules', description='This parameter is required.'),
}

model CreateRulesResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
  ruleIds?: [ 
    {
      priority?: int32(name='Priority', description='The priority of the forwarding rule. Valid values: **1 to 10000**. A smaller value indicates a higher priority.

> The priorities of the forwarding rules created for the same listener must be unique.', example='10'),
      ruleId?: string(name='RuleId', description='The forwarding rule ID.', example='rule-a3x3pg1yohq3lq****'),
    }
  ](name='RuleIds', description='The priority of the forwarding rule. Valid values: **1 to 10000**. A lower value specifies a higher priority.

> The priorities of the forwarding rules created for the same listener is unique.'),
}

model CreateRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRulesResponseBody(name='body'),
}

/**
 * @summary Creates multiple forwarding rules at a time.
 *
 * @description When you call this operation, take note of the following limits:
 * *   When you configure the **Redirect** action, do not use the default values for parameters other than **HttpCode**.
 * *   If you specify multiple actions in a forward rule, you must specify the **ForwardGroup** parameter along with the **Rewrite** parameter.
 * *   **CreateRules** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListRules](https://help.aliyun.com/document_detail/214379.html) operation to query the status of the forwarding rules.
 *     *   If the forwarding rules are in the **Provisioning** state, the forwarding rules are being created.
 *     *   If the forwarding rules are in the **Available** state, the forwarding rules are created.
 * *   You can set **RuleConditions** and **RuleActions** to add conditions and actions to a forwarding rule. Take note of the following limits on the number of conditions and the number of actions in each forwarding rule:
 *     *   Conditions: 5 for each basic ALB instance, 10 for each standard ALB instance, and 10 for each WAF-enabled ALB instance.
 *     *   Actions: 3 for each basic ALB instance, 5 for each standard ALB instance, and 5 for each WAF-enabled ALB instance.
 *
 * @param request CreateRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRulesResponse
 */
async function createRulesWithOptions(request: CreateRulesRequest, runtime: $RuntimeOptions): CreateRulesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!$isNull(request.rules)) {
    bodyFlat['Rules'] = request.rules;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateRules',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates multiple forwarding rules at a time.
 *
 * @description When you call this operation, take note of the following limits:
 * *   When you configure the **Redirect** action, do not use the default values for parameters other than **HttpCode**.
 * *   If you specify multiple actions in a forward rule, you must specify the **ForwardGroup** parameter along with the **Rewrite** parameter.
 * *   **CreateRules** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListRules](https://help.aliyun.com/document_detail/214379.html) operation to query the status of the forwarding rules.
 *     *   If the forwarding rules are in the **Provisioning** state, the forwarding rules are being created.
 *     *   If the forwarding rules are in the **Available** state, the forwarding rules are created.
 * *   You can set **RuleConditions** and **RuleActions** to add conditions and actions to a forwarding rule. Take note of the following limits on the number of conditions and the number of actions in each forwarding rule:
 *     *   Conditions: 5 for each basic ALB instance, 10 for each standard ALB instance, and 10 for each WAF-enabled ALB instance.
 *     *   Actions: 3 for each basic ALB instance, 5 for each standard ALB instance, and 5 for each WAF-enabled ALB instance.
 *
 * @param request CreateRulesRequest
 * @return CreateRulesResponse
 */
async function createRules(request: CreateRulesRequest): CreateRulesResponse {
  var runtime = new $RuntimeOptions{};
  return createRulesWithOptions(request, runtime);
}

model CreateSecurityPolicyRequest {
  ciphers?: [ string ](name='Ciphers', description='The supported cipher suites.

This parameter is required.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

> If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**(default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-atstuj3rtop****'),
  securityPolicyName?: string(name='SecurityPolicyName', description='The name of the security policy.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.

This parameter is required.', example='test-secrity'),
  TLSVersions?: [ string ](name='TLSVersions', description='The supported Transport Layer Security (TLS) protocol versions.

This parameter is required.'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tag', description='The tags.'),
}

model CreateSecurityPolicyResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The security policy ID.', example='scp-bp1bpn0kn9****'),
}

model CreateSecurityPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSecurityPolicyResponseBody(name='body'),
}

/**
 * @summary Creates a custom security policy in a region.
 *
 * @param request CreateSecurityPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSecurityPolicyResponse
 */
async function createSecurityPolicyWithOptions(request: CreateSecurityPolicyRequest, runtime: $RuntimeOptions): CreateSecurityPolicyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ciphers)) {
    query['Ciphers'] = request.ciphers;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.securityPolicyName)) {
    query['SecurityPolicyName'] = request.securityPolicyName;
  }
  if (!$isNull(request.TLSVersions)) {
    query['TLSVersions'] = request.TLSVersions;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateSecurityPolicy',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a custom security policy in a region.
 *
 * @param request CreateSecurityPolicyRequest
 * @return CreateSecurityPolicyResponse
 */
async function createSecurityPolicy(request: CreateSecurityPolicyRequest): CreateSecurityPolicyResponse {
  var runtime = new $RuntimeOptions{};
  return createSecurityPolicyWithOptions(request, runtime);
}

model CreateServerGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  connectionDrainConfig?: {
    connectionDrainEnabled?: boolean(name='ConnectionDrainEnabled', description='Specifies whether to enable connection draining. Valid values:

*   **true**
*   **false** (default)', example='false'),
    connectionDrainTimeout?: int32(name='ConnectionDrainTimeout', description='The timeout period of connection draining.

Valid values: **0** to **900**.

Default value: **300**.', example='300'),
  }(name='ConnectionDrainConfig', description='The configurations of connection draining.

After connection draining is enabled, ALB maintains data transmission for a period of time after the backend server is removed or declared unhealthy.


>*   Basic ALB instances do not support connection draining. Standard and WAF-enabled ALB instances support connection draining.
>*   Server groups of the instance and IP types support connection draining. Server groups of the Function Compute type do not support connection draining.'),
  crossZoneEnabled?: boolean(name='CrossZoneEnabled', description='Specifies whether to enable cross-zone load balancing. Valid values:

*   **true** (default)
*   **false**

> *   Basic ALB instances do not support server groups that have cross-zone load balancing disabled. Only Standard and WAF-enabled ALB instances support server groups that have cross-zone load balancing.
> *   Cross-zone load balancing can be disabled for server groups of the server and IP type, but not for server groups of the Function Compute type.
> *   When cross-zone load balancing is disabled, session persistence cannot be enabled.', example='true'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  healthCheckConfig?: {
    healthCheckCodes?: [ string ](name='HealthCheckCodes', description='The HTTP status code that indicates healthy backend servers.'),
    healthCheckConnectPort?: int32(name='HealthCheckConnectPort', description='The backend port that is used for health checks.

Valid values: **0** to **65535**

The default value is **0**, which specifies that the port of a backend server is used for health checks.', example='80'),
    healthCheckEnabled?: boolean(name='HealthCheckEnabled', description='Specifies whether to enable the health check feature. Valid values:

*   **true**
*   **false**

>  If the **ServerGroupType** parameter is set to **Instance** or **Ip**, the health check feature is enabled by default. If the **ServerGroupType** parameter is set to **Fc**, the health check feature is disabled by default.

This parameter is required.', example='true'),
    healthCheckHost?: string(name='HealthCheckHost', description='The domain name that is used for health checks.

*   **Backend Server Internal IP** (default): Use the internal IP address of backend servers as the health check domain name.

*   **Custom Domain Name**: Enter a domain name.

    *   The domain name must be 1 to 80 characters in length.
    *   The domain name can contain lowercase letters, digits, hyphens (-), and periods (.).
    *   The domain name must contain at least one period (.) but cannot start or end with a period (.).
    *   The rightmost domain label of the domain name can contain only letters, and cannot contain digits or hyphens (-).
    *   The domain name cannot start or end with a hyphen (-).

>  This parameter takes effect only if **HealthCheckProtocol** is set to **HTTP**, **HTTPS**, or **gRPC**.', example='www.example.com'),
    healthCheckHttpVersion?: string(name='HealthCheckHttpVersion', description='The version of the HTTP protocol. Valid values: **HTTP1.0** and **HTTP1.1**. Default value: HTTP1.1.

>  This parameter takes effect only if **HealthCheckProtocol** is set to **HTTP** or **HTTPS**.', example='HTTP1.1'),
    healthCheckInterval?: int32(name='HealthCheckInterval', description='The interval at which health checks are performed. Unit: seconds

Valid values: **1** to **50**

Default value: **2**.', example='2'),
    healthCheckMethod?: string(name='HealthCheckMethod', description='The HTTP method that is used for health checks. Valid values:

*   **GET**: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.
*   **POST**: By default, gRPC health checks use the POST method.
*   **HEAD** (default): By default, HTTP and HTTPS use the HEAD method.

>  This parameter takes effect only if **HealthCheckProtocol** is set to **HTTP**, **HTTPS**, or **gRPC**.', example='HEAD'),
    healthCheckPath?: string(name='HealthCheckPath', description='The URL that is used for health checks.

The URL must be 1 to 80 characters in length, and can contain letters, digits, and the following special characters: `- / . % ? # & =`. It can also contain the following extended characters: `_ ; ~ ! ( ) * [ ] @ $ ^ : \\\\" , +`. The URL must start with a forward slash (/).

>  This parameter takes effect only if **HealthCheckProtocol** is set to **HTTP** or **HTTPS**.', example='/test/index.html'),
    healthCheckProtocol?: string(name='HealthCheckProtocol', description='The protocol that is used for health checks. Valid values:

*   **HTTP**: HTTP health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers.
*   **HTTPS**: HTTPS health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers. HTTPS provides higher security than HTTP because HTTPS supports data encryption.
*   **TCP**: TCP health checks send TCP SYN packets to a backend server to probe the availability of backend servers.
*   **gRPC**: gRPC health checks send POST or GET requests to a backend server to check whether the backend server is healthy.', example='HTTP'),
    healthCheckTimeout?: int32(name='HealthCheckTimeout', description='The timeout period of a health check response. If a backend server does not respond within the specified timeout period, the backend server is declared unhealthy. Unit: seconds

Valid values: **1** to **300**

Default value: **5**', example='5'),
    healthyThreshold?: int32(name='HealthyThreshold', description='The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health check status of the backend server changes from **fail** to **success**.

Valid values: **2** to **10**

Default value: **3**.', example='3'),
    unhealthyThreshold?: int32(name='UnhealthyThreshold', description='The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health check status of the backend server changes from **success** to **fail**.

Valid values: **2** to **10**

Default value: **3**', example='3'),
  }(name='HealthCheckConfig', description='The configuration of the health check feature.

This parameter is required.'),
  ipv6Enabled?: boolean(name='Ipv6Enabled', description='Specifies whether to enable Ipv6.', example='false'),
  protocol?: string(name='Protocol', description='The backend protocol. Valid values:

*   **HTTP**: allows you to associate an HTTPS, HTTP, or QUIC listener with the server group. This is the default value.
*   **HTTPS**: allows you to associate HTTPS listeners with backend servers.
*   **gRPC**: allows you to associate an HTTPS or QUIC listener with the server group.

>  You do not need to specify a backend protocol if you set **ServerGroupType** to **Fc**.', example='HTTP'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-atstuj3rtop****'),
  scheduler?: string(name='Scheduler', description='The scheduling algorithm. Valid values:

*   **Wrr** (default): The weighted round-robin algorithm is used. Backend servers that have higher weights receive more requests than those that have lower weights.
*   **Wlc**: The weighted least connections algorithm is used. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.
*   **Sch**: The consistent hashing algorithm is used. Requests from the same source IP address are distributed to the same backend server.

> This parameter takes effect when the **ServerGroupType** parameter is set to **Instance** or **Ip**.', example='Wrr'),
  serverGroupName?: string(name='ServerGroupName', description='The name of the server group. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.

This parameter is required.', example='sg-atstuj3rtoptyui****'),
  serverGroupType?: string(name='ServerGroupType', description='The type of server group. Valid values:

*   **Instance** (default): allows you to add servers by specifying **Ecs**, **Eni**, or **Eci**.
*   **Ip**: allows you to add servers by specifying IP addresses.
*   **Fc**: allows you to add servers by specifying functions of Function Compute.', example='Instance'),
  serviceName?: string(name='ServiceName', description='This parameter is available only if the ALB Ingress controller is used. In this case, set this parameter to the name of the `Kubernetes Service` that is associated with the server group.', example='test'),
  slowStartConfig?: {
    slowStartDuration?: int32(name='SlowStartDuration', description='The duration of a slow start.
Valid values: 30 to 900.
Default value: 30.', example='30'),
    slowStartEnabled?: boolean(name='SlowStartEnabled', description='Specifies whether to enable slow starts. Valid values:

- true

- false(default)', example='false'),
  }(name='SlowStartConfig', description='The configurations of slow starts.
After slow starts are enabled, SLB prefetches data to newly added backend servers. Requests distributed to the backend servers gradually increase.

> - Basic SLB instances do not support slow starts. Standard and WAF-enabled SLB instances support slow starts. 
>* Server groups of the server and IP types support slow starts. Server groups of the Function Compute type do not support slow starts.
>* Slow start is supported only by the weighted round-robin scheduling algorithm.'),
  stickySessionConfig?: {
    cookie?: string(name='Cookie', description='The cookie that you want to configure for the server.

The cookie must be 1 to 200 characters in length, and can contain only ASCII letters and digits. It cannot contain commas (,), semicolons (;), or space characters. It cannot start with a dollar sign ($).

>  This parameter takes effect only when **StickySessionEnabled** is set to **true** and **StickySessionType** is set to **server**.', example='B490B5EBF6F3CD402E515D22BCDA****'),
    cookieTimeout?: int32(name='CookieTimeout', description='The maximum amount of time to wait before the session cookie expires. Unit: seconds

Valid values: **1** to **86400**

Default value: **1000**

>  This parameter takes effect only when **StickySessionEnabled** is set to **true** and **StickySessionType** is set to **Insert**.', example='1000'),
    stickySessionEnabled?: boolean(name='StickySessionEnabled', description='Specifies whether to enable session persistence. Valid values:

*   **true**
*   **false**

>  This parameter takes effect when the **ServerGroupType** parameter is set to **Instance** or **Ip**.', example='false'),
    stickySessionType?: string(name='StickySessionType', description='The method that is used to handle cookies. Valid values:

*   **Insert** (default value): inserts a cookie. The first time a client accesses ALB, ALB inserts the SERVERID cookie into the HTTP or HTTPS response packet. Subsequent requests from the client that carry this cookie are forwarded to the same backend server as the first request.
*   **Server**: rewrites a cookie. ALB rewrites the custom cookies in requests from a client. Subsequent requests from the client that carry the new cookie are forwarded to the same backend server as the first request.

>  This parameter takes effect when the **StickySessionEnabled** parameter is set to **true**.', example='Insert'),
  }(name='StickySessionConfig', description='The configuration of session persistence.

>  This parameter takes effect when the **ServerGroupType** parameter is set to **Instance** or **Ip**.'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length, and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length, and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tag', description='The tag.'),
  uchConfig?: {
    type?: string(name='Type', description='The type of the parameter.

This parameter is required.', example='QueryString'),
    value?: string(name='Value', description='The parameter value for consistent hashing.

This parameter is required.', example='abc'),
  }(name='UchConfig', description='The configuration of consistent hashing based on URLs.'),
  upstreamKeepaliveEnabled?: boolean(name='UpstreamKeepaliveEnabled', description='Specifies whether to enable persistent TCP connections.', example='false'),
  vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC). You can add only servers that are deployed in the specified VPC to the server group.

>  This parameter takes effect when the **ServerGroupType** parameter is set to **Instance** or **Ip**.', example='vpc-bp15zckdt37pq72zv****'),
}

model CreateServerGroupResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous job.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
  serverGroupId?: string(name='ServerGroupId', description='The ID of the server group.', example='sg-atstuj3rtoptyui****'),
}

model CreateServerGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateServerGroupResponseBody(name='body'),
}

/**
 * @summary Creates a server group in a region.
 *
 * @description **CreateServerGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) to query the status of a server group.
 * *   If a server group is in the **Creating** state, it indicates that the server group is being created.
 * *   If a server group is in the **Available** state, it indicates that the server group is created.
 *
 * @param request CreateServerGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateServerGroupResponse
 */
async function createServerGroupWithOptions(request: CreateServerGroupRequest, runtime: $RuntimeOptions): CreateServerGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.connectionDrainConfig)) {
    query['ConnectionDrainConfig'] = request.connectionDrainConfig;
  }
  if (!$isNull(request.crossZoneEnabled)) {
    query['CrossZoneEnabled'] = request.crossZoneEnabled;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.healthCheckConfig)) {
    query['HealthCheckConfig'] = request.healthCheckConfig;
  }
  if (!$isNull(request.ipv6Enabled)) {
    query['Ipv6Enabled'] = request.ipv6Enabled;
  }
  if (!$isNull(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.scheduler)) {
    query['Scheduler'] = request.scheduler;
  }
  if (!$isNull(request.serverGroupName)) {
    query['ServerGroupName'] = request.serverGroupName;
  }
  if (!$isNull(request.serverGroupType)) {
    query['ServerGroupType'] = request.serverGroupType;
  }
  if (!$isNull(request.serviceName)) {
    query['ServiceName'] = request.serviceName;
  }
  if (!$isNull(request.slowStartConfig)) {
    query['SlowStartConfig'] = request.slowStartConfig;
  }
  if (!$isNull(request.stickySessionConfig)) {
    query['StickySessionConfig'] = request.stickySessionConfig;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.uchConfig)) {
    query['UchConfig'] = request.uchConfig;
  }
  if (!$isNull(request.upstreamKeepaliveEnabled)) {
    query['UpstreamKeepaliveEnabled'] = request.upstreamKeepaliveEnabled;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateServerGroup',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a server group in a region.
 *
 * @description **CreateServerGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) to query the status of a server group.
 * *   If a server group is in the **Creating** state, it indicates that the server group is being created.
 * *   If a server group is in the **Available** state, it indicates that the server group is created.
 *
 * @param request CreateServerGroupRequest
 * @return CreateServerGroupResponse
 */
async function createServerGroup(request: CreateServerGroupRequest): CreateServerGroupResponse {
  var runtime = new $RuntimeOptions{};
  return createServerGroupWithOptions(request, runtime);
}

model DeleteAScriptsRequest {
  AScriptIds?: [ string ](name='AScriptIds', description='The AScript rule IDs.

This parameter is required.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.', example='f516e84e-fc0c-4c2d-a461-6cd774a84dbd'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**(default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
}

model DeleteAScriptsResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='03cf3fe1-ab37-479b-92a6-b481d762****'),
  requestId?: string(name='RequestId', description='The request ID.', example='1B7B7695-3596-50C8-B739-030C6C685E61'),
}

model DeleteAScriptsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAScriptsResponseBody(name='body'),
}

/**
 * @summary Deletes AScript rules.
 *
 * @description **DeleteAScripts** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAScripts](https://help.aliyun.com/document_detail/472574.html) operation to query the status of the task:
 * *   If an AScript rule is in the **Deleting** state, the AScript rule is being deleted.
 * *   If an AScript rule cannot be found, the AScript rule is deleted.
 *
 * @param request DeleteAScriptsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAScriptsResponse
 */
async function deleteAScriptsWithOptions(request: DeleteAScriptsRequest, runtime: $RuntimeOptions): DeleteAScriptsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.AScriptIds)) {
    query['AScriptIds'] = request.AScriptIds;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteAScripts',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes AScript rules.
 *
 * @description **DeleteAScripts** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAScripts](https://help.aliyun.com/document_detail/472574.html) operation to query the status of the task:
 * *   If an AScript rule is in the **Deleting** state, the AScript rule is being deleted.
 * *   If an AScript rule cannot be found, the AScript rule is deleted.
 *
 * @param request DeleteAScriptsRequest
 * @return DeleteAScriptsResponse
 */
async function deleteAScripts(request: DeleteAScriptsRequest): DeleteAScriptsResponse {
  var runtime = new $RuntimeOptions{};
  return deleteAScriptsWithOptions(request, runtime);
}

model DeleteAclRequest {
  aclId?: string(name='AclId', description='The ID of the ACL.

This parameter is required.', example='nacl-hp34s2h0xx1ht4nwo****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
}

model DeleteAclResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DeleteAclResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAclResponseBody(name='body'),
}

/**
 * @summary Deletes an access control list (ACL).
 *
 * @description **DeleteAcl** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAcls](https://help.aliyun.com/document_detail/213617.html) operation to query the status of the task.
 * *   If the ACL is in the **Deleting** state, the ACL is being deleted.
 * *   If the ACL cannot be found, the ACL is deleted.
 *
 * @param request DeleteAclRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAclResponse
 */
async function deleteAclWithOptions(request: DeleteAclRequest, runtime: $RuntimeOptions): DeleteAclResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteAcl',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes an access control list (ACL).
 *
 * @description **DeleteAcl** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAcls](https://help.aliyun.com/document_detail/213617.html) operation to query the status of the task.
 * *   If the ACL is in the **Deleting** state, the ACL is being deleted.
 * *   If the ACL cannot be found, the ACL is deleted.
 *
 * @param request DeleteAclRequest
 * @return DeleteAclResponse
 */
async function deleteAcl(request: DeleteAclRequest): DeleteAclResponse {
  var runtime = new $RuntimeOptions{};
  return deleteAclWithOptions(request, runtime);
}

model DeleteHealthCheckTemplatesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a **2xx HTTP** status code is returned and the operation is performed.', example='true'),
  healthCheckTemplateIds?: [ string ](name='HealthCheckTemplateIds', description='The IDs of health check templates. You can specify at most 10 IDs.

This parameter is required.', example='acl-123'),
}

model DeleteHealthCheckTemplatesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model DeleteHealthCheckTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteHealthCheckTemplatesResponseBody(name='body'),
}

/**
 * @summary Deletes health check templates.
 *
 * @param request DeleteHealthCheckTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteHealthCheckTemplatesResponse
 */
async function deleteHealthCheckTemplatesWithOptions(request: DeleteHealthCheckTemplatesRequest, runtime: $RuntimeOptions): DeleteHealthCheckTemplatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.healthCheckTemplateIds)) {
    query['HealthCheckTemplateIds'] = request.healthCheckTemplateIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteHealthCheckTemplates',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes health check templates.
 *
 * @param request DeleteHealthCheckTemplatesRequest
 * @return DeleteHealthCheckTemplatesResponse
 */
async function deleteHealthCheckTemplates(request: DeleteHealthCheckTemplatesRequest): DeleteHealthCheckTemplatesResponse {
  var runtime = new $RuntimeOptions{};
  return deleteHealthCheckTemplatesWithOptions(request, runtime);
}

model DeleteListenerRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**: (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='true'),
  listenerId?: string(name='ListenerId', description='The ID of the Application Load Balancer (ALB) listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
}

model DeleteListenerResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model DeleteListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteListenerResponseBody(name='body'),
}

/**
 * @summary Deletes a listener.
 *
 * @description **DeleteListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [GetListenerAttribute](https://help.aliyun.com/document_detail/2254865.html) to query the status of the task.
 * *   If the listener is in the **Deleting** state, the listener is being deleted.
 * *   If the listener cannot be found, the listener is deleted.
 *
 * @param request DeleteListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteListenerResponse
 */
async function deleteListenerWithOptions(request: DeleteListenerRequest, runtime: $RuntimeOptions): DeleteListenerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteListener',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a listener.
 *
 * @description **DeleteListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [GetListenerAttribute](https://help.aliyun.com/document_detail/2254865.html) to query the status of the task.
 * *   If the listener is in the **Deleting** state, the listener is being deleted.
 * *   If the listener cannot be found, the listener is deleted.
 *
 * @param request DeleteListenerRequest
 * @return DeleteListenerResponse
 */
async function deleteListener(request: DeleteListenerRequest): DeleteListenerResponse {
  var runtime = new $RuntimeOptions{};
  return deleteListenerWithOptions(request, runtime);
}

model DeleteLoadBalancerRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='true'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.

This parameter is required.', example='lb-bp1b6c719dfa08ex****'),
}

model DeleteLoadBalancerResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DeleteLoadBalancerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteLoadBalancerResponseBody(name='body'),
}

/**
 * @summary Deletes an Application Load Balancer (ALB) instance.
 *
 * @description **DeleteLoadBalancer** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) to query the status of the task.
 * *   If an ALB instance is in the **Deleting** state, the ALB instance is being deleted.
 * *   If an ALB instance cannot be found, the ALB instance is deleted.
 *
 * @param request DeleteLoadBalancerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteLoadBalancerResponse
 */
async function deleteLoadBalancerWithOptions(request: DeleteLoadBalancerRequest, runtime: $RuntimeOptions): DeleteLoadBalancerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteLoadBalancer',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes an Application Load Balancer (ALB) instance.
 *
 * @description **DeleteLoadBalancer** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) to query the status of the task.
 * *   If an ALB instance is in the **Deleting** state, the ALB instance is being deleted.
 * *   If an ALB instance cannot be found, the ALB instance is deleted.
 *
 * @param request DeleteLoadBalancerRequest
 * @return DeleteLoadBalancerResponse
 */
async function deleteLoadBalancer(request: DeleteLoadBalancerRequest): DeleteLoadBalancerResponse {
  var runtime = new $RuntimeOptions{};
  return deleteLoadBalancerWithOptions(request, runtime);
}

model DeleteRuleRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: sends the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**: performs a dry run and sends the request. If the request passes the dry run, the `HTTP_2xx` status code is returned and the operation is performed. This is the default value.', example='true'),
  ruleId?: string(name='RuleId', description='The ID of the forwarding rule.

This parameter is required.', example='rule-doc****'),
}

model DeleteRuleResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model DeleteRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRuleResponseBody(name='body'),
}

/**
 * @summary Deletes a forwarding rule.
 *
 * @description **DeleteRule** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListRules](https://help.aliyun.com/document_detail/214379.html) operation to query the status of a forwarding rule:
 * *   If the forwarding rule is in the **Deleting** state, the forwarding rule is being deleted.
 * *   If the forwarding rule cannot be found, the forwarding rule is deleted.
 *
 * @param request DeleteRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRuleResponse
 */
async function deleteRuleWithOptions(request: DeleteRuleRequest, runtime: $RuntimeOptions): DeleteRuleResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteRule',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a forwarding rule.
 *
 * @description **DeleteRule** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListRules](https://help.aliyun.com/document_detail/214379.html) operation to query the status of a forwarding rule:
 * *   If the forwarding rule is in the **Deleting** state, the forwarding rule is being deleted.
 * *   If the forwarding rule cannot be found, the forwarding rule is deleted.
 *
 * @param request DeleteRuleRequest
 * @return DeleteRuleResponse
 */
async function deleteRule(request: DeleteRuleRequest): DeleteRuleResponse {
  var runtime = new $RuntimeOptions{};
  return deleteRuleWithOptions(request, runtime);
}

model DeleteRulesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: checks the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='false'),
  ruleIds?: [ string ](name='RuleIds', description='The forwarding rules.

This parameter is required.'),
}

model DeleteRulesResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='7BED4F62-3E6E-5E4F-8C53-2D8CCE77F2ED'),
}

model DeleteRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRulesResponseBody(name='body'),
}

/**
 * @summary Deletes one or more forwarding rules from a listener at a time.
 *
 * @description **DeleteRules** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListRules](https://help.aliyun.com/document_detail/214379.html) operation to query the status of forwarding rules.
 * *   If the forwarding rules are in the **Deleting** state, the forwarding rules are being deleted.
 * *   If the forwarding rules cannot be found, the forwarding rules are deleted.
 *
 * @param request DeleteRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRulesResponse
 */
async function deleteRulesWithOptions(request: DeleteRulesRequest, runtime: $RuntimeOptions): DeleteRulesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.ruleIds)) {
    query['RuleIds'] = request.ruleIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteRules',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes one or more forwarding rules from a listener at a time.
 *
 * @description **DeleteRules** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListRules](https://help.aliyun.com/document_detail/214379.html) operation to query the status of forwarding rules.
 * *   If the forwarding rules are in the **Deleting** state, the forwarding rules are being deleted.
 * *   If the forwarding rules cannot be found, the forwarding rules are deleted.
 *
 * @param request DeleteRulesRequest
 * @return DeleteRulesResponse
 */
async function deleteRules(request: DeleteRulesRequest): DeleteRulesResponse {
  var runtime = new $RuntimeOptions{};
  return deleteRulesWithOptions(request, runtime);
}

model DeleteSecurityPolicyRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

> If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The security policy ID.

This parameter is required.', example='spy-n0kn923****'),
}

model DeleteSecurityPolicyResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
}

model DeleteSecurityPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSecurityPolicyResponseBody(name='body'),
}

/**
 * @summary Deletes a custom security policy.
 *
 * @param request DeleteSecurityPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSecurityPolicyResponse
 */
async function deleteSecurityPolicyWithOptions(request: DeleteSecurityPolicyRequest, runtime: $RuntimeOptions): DeleteSecurityPolicyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.securityPolicyId)) {
    query['SecurityPolicyId'] = request.securityPolicyId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteSecurityPolicy',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a custom security policy.
 *
 * @param request DeleteSecurityPolicyRequest
 * @return DeleteSecurityPolicyResponse
 */
async function deleteSecurityPolicy(request: DeleteSecurityPolicyRequest): DeleteSecurityPolicyResponse {
  var runtime = new $RuntimeOptions{};
  return deleteSecurityPolicyWithOptions(request, runtime);
}

model DeleteServerGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  serverGroupId?: string(name='ServerGroupId', description='The ID of the server group.

This parameter is required.', example='sgp-cige6j****'),
}

model DeleteServerGroupResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous job.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model DeleteServerGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteServerGroupResponseBody(name='body'),
}

/**
 * @summary Deletes a server group.
 *
 * @description **DeleteServerGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the status of the task.
 * *   If a server group is in the **Deleting** state, it indicates that the server group is being deleted.
 * *   If a specified server group cannot be found, it indicates that the server group has been deleted.
 *
 * @param request DeleteServerGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteServerGroupResponse
 */
async function deleteServerGroupWithOptions(request: DeleteServerGroupRequest, runtime: $RuntimeOptions): DeleteServerGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.serverGroupId)) {
    query['ServerGroupId'] = request.serverGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteServerGroup',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a server group.
 *
 * @description **DeleteServerGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the status of the task.
 * *   If a server group is in the **Deleting** state, it indicates that the server group is being deleted.
 * *   If a specified server group cannot be found, it indicates that the server group has been deleted.
 *
 * @param request DeleteServerGroupRequest
 * @return DeleteServerGroupResponse
 */
async function deleteServerGroup(request: DeleteServerGroupRequest): DeleteServerGroupResponse {
  var runtime = new $RuntimeOptions{};
  return deleteServerGroupWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The supported language. Valid values:

*   **zh-CN** (default): Chinese
*   **en-US**: English
*   **ja**: Japanese', example='zh-CN'),
}

model DescribeRegionsResponseBody = {
  regions?: [ 
    {
      localName?: string(name='LocalName', description='The name of the region.', example='China (Hangzhou)'),
      regionEndpoint?: string(name='RegionEndpoint', description='The endpoint of region service.', example='alb.cn-hangzhou.aliyuncs.com'),
      regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
    }
  ](name='Regions', description='The regions.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Queries available regions.
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: $RuntimeOptions): DescribeRegionsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRegions',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries available regions.
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new $RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeZonesRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The supported language. Valid values:

*   **zh-CN** (default): Chinese
*   **en-US**: English
*   **ja**: Japanese', example='zh-CN'),
}

model DescribeZonesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  zones?: [ 
    {
      localName?: string(name='LocalName', description='The name of the zone.', example='Hangzhou Zone G'),
      zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hangzhou-g'),
    }
  ](name='Zones', description='The zones.', example='FFmyTO70tTpLG6I3FmYAXGKPdzTKM4svjIT4VQig7tTMKqiHlxKt2p5Zuz45p+Lxdq'),
}

model DescribeZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeZonesResponseBody(name='body'),
}

/**
 * @summary Queries zones in a region.
 *
 * @param request DescribeZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeZonesResponse
 */
async function describeZonesWithOptions(request: DescribeZonesRequest, runtime: $RuntimeOptions): DescribeZonesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeZones',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries zones in a region.
 *
 * @param request DescribeZonesRequest
 * @return DescribeZonesResponse
 */
async function describeZones(request: DescribeZonesRequest): DescribeZonesResponse {
  var runtime = new $RuntimeOptions{};
  return describeZonesWithOptions(request, runtime);
}

model DetachCommonBandwidthPackageFromLoadBalancerRequest {
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The EIP bandwidth plan ID.

This parameter is required.', example='cbwp-bp1pzf0ym72pu3y76****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.

This parameter is required.', example='alb-d676fho813rmu3****'),
  regionId?: string(name='RegionId', description='The region ID of the ALB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/36063.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model DetachCommonBandwidthPackageFromLoadBalancerResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='2EF39708-974B-5E74-AFF5-3445263035A8'),
}

model DetachCommonBandwidthPackageFromLoadBalancerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachCommonBandwidthPackageFromLoadBalancerResponseBody(name='body'),
}

/**
 * @summary Disassociates an elastic IP address (EIP) bandwidth plan from an Application Load Balancer (ALB) instance.
 *
 * @description **DetachCommonBandwidthPackageFromLoadBalancer** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214359.html) operation to query the status of the task.
 * *   If an ALB instance is in the **Configuring** state, the EIP bandwidth plan is being disassociated from the ALB instance.
 * *   If an ALB instance is in the **Active** state, the EIP bandwidth plan is disassociated from the ALB instance.
 *
 * @param request DetachCommonBandwidthPackageFromLoadBalancerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachCommonBandwidthPackageFromLoadBalancerResponse
 */
async function detachCommonBandwidthPackageFromLoadBalancerWithOptions(request: DetachCommonBandwidthPackageFromLoadBalancerRequest, runtime: $RuntimeOptions): DetachCommonBandwidthPackageFromLoadBalancerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bandwidthPackageId)) {
    query['BandwidthPackageId'] = request.bandwidthPackageId;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DetachCommonBandwidthPackageFromLoadBalancer',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disassociates an elastic IP address (EIP) bandwidth plan from an Application Load Balancer (ALB) instance.
 *
 * @description **DetachCommonBandwidthPackageFromLoadBalancer** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214359.html) operation to query the status of the task.
 * *   If an ALB instance is in the **Configuring** state, the EIP bandwidth plan is being disassociated from the ALB instance.
 * *   If an ALB instance is in the **Active** state, the EIP bandwidth plan is disassociated from the ALB instance.
 *
 * @param request DetachCommonBandwidthPackageFromLoadBalancerRequest
 * @return DetachCommonBandwidthPackageFromLoadBalancerResponse
 */
async function detachCommonBandwidthPackageFromLoadBalancer(request: DetachCommonBandwidthPackageFromLoadBalancerRequest): DetachCommonBandwidthPackageFromLoadBalancerResponse {
  var runtime = new $RuntimeOptions{};
  return detachCommonBandwidthPackageFromLoadBalancerWithOptions(request, runtime);
}

model DisableDeletionProtectionRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**: (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='true'),
  resourceId?: string(name='ResourceId', description='The ALB instance ID.

This parameter is required.', example='re-atstuj3rtop****'),
}

model DisableDeletionProtectionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DisableDeletionProtectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableDeletionProtectionResponseBody(name='body'),
}

/**
 * @summary Disables deletion protection for an Application Load Balancer (ALB) instance.
 *
 * @param request DisableDeletionProtectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableDeletionProtectionResponse
 */
async function disableDeletionProtectionWithOptions(request: DisableDeletionProtectionRequest, runtime: $RuntimeOptions): DisableDeletionProtectionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DisableDeletionProtection',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disables deletion protection for an Application Load Balancer (ALB) instance.
 *
 * @param request DisableDeletionProtectionRequest
 * @return DisableDeletionProtectionResponse
 */
async function disableDeletionProtection(request: DisableDeletionProtectionRequest): DisableDeletionProtectionResponse {
  var runtime = new $RuntimeOptions{};
  return disableDeletionProtectionWithOptions(request, runtime);
}

model DisableLoadBalancerAccessLogRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

*   If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  loadBalancerId?: string(name='LoadBalancerId', description='The SLB instance ID.

This parameter is required.', example='lb-bp1b6c719dfa08ex*****'),
}

model DisableLoadBalancerAccessLogResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
}

model DisableLoadBalancerAccessLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableLoadBalancerAccessLogResponseBody(name='body'),
}

/**
 * @summary Disables the access log feature for a Server Load Balancer (SLB) instance.
 *
 * @param request DisableLoadBalancerAccessLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableLoadBalancerAccessLogResponse
 */
async function disableLoadBalancerAccessLogWithOptions(request: DisableLoadBalancerAccessLogRequest, runtime: $RuntimeOptions): DisableLoadBalancerAccessLogResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DisableLoadBalancerAccessLog',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disables the access log feature for a Server Load Balancer (SLB) instance.
 *
 * @param request DisableLoadBalancerAccessLogRequest
 * @return DisableLoadBalancerAccessLogResponse
 */
async function disableLoadBalancerAccessLog(request: DisableLoadBalancerAccessLogRequest): DisableLoadBalancerAccessLogResponse {
  var runtime = new $RuntimeOptions{};
  return disableLoadBalancerAccessLogWithOptions(request, runtime);
}

model DisableLoadBalancerIpv6InternetRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.

This parameter is required.', example='alb-chugtlrj1iusjh****'),
}

model DisableLoadBalancerIpv6InternetResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='d12871a6-ebb2-41f3-8d74-d9f452bb****'),
  requestId?: string(name='RequestId', description='The request ID.', example='7D866E37-1123-5160-AFF1-BDAF5EB86A8A'),
}

model DisableLoadBalancerIpv6InternetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableLoadBalancerIpv6InternetResponseBody(name='body'),
}

/**
 * @summary Changes the type of the IPv6 address that is used by a dual-stack Application Load Balancer (ALB) instance from public to private.
 *
 * @description ### Prerequisites
 * An ALB instance is created and IPv4/IPv6 dual stack is enabled for the instance. You can call the [CreateLoadBalancer](https://help.aliyun.com/document_detail/214358.html) operation and set **AddressIpVersion** to **DualStack** to create a dual-stack ALB instance.
 * > If you set **AddressIpVersion** to **DualStack**:
 * *   If you set **AddressType** to **Internet**, the ALB instance uses a public IPv4 IP address and a private IPv6 address.
 * *   If you set **AddressType** to **Intranet**, the ALB instance uses a private IPv4 IP address and a private IPv6 address.
 * ### Description
 * *   After the DisableLoadBalancerIpv6Internet operation is called, the value of **Ipv6AddressType** is changed to **Intranet** and the type of the IPv6 address of the ALB instance is changed from public to private. If you upgrade the instance or the instance scales elastic network interfaces (ENIs) along with workloads, private IPv6 addresses are automatically enabled for the instance and the new ENIs. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the value of **Ipv6AddressType**.
 * *   **DisableLoadBalancerIpv6Internet** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the status of the task.
 *     *   If the ALB instance is in the **Configuring** state, the network type of the IPv6 address that is used by the ALB instance is being changed.
 *     *   If the ALB instance is in the **Active** state, the network type of the IPv6 address that is used by the ALB instance is changed.
 *
 * @param request DisableLoadBalancerIpv6InternetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableLoadBalancerIpv6InternetResponse
 */
async function disableLoadBalancerIpv6InternetWithOptions(request: DisableLoadBalancerIpv6InternetRequest, runtime: $RuntimeOptions): DisableLoadBalancerIpv6InternetResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DisableLoadBalancerIpv6Internet',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the type of the IPv6 address that is used by a dual-stack Application Load Balancer (ALB) instance from public to private.
 *
 * @description ### Prerequisites
 * An ALB instance is created and IPv4/IPv6 dual stack is enabled for the instance. You can call the [CreateLoadBalancer](https://help.aliyun.com/document_detail/214358.html) operation and set **AddressIpVersion** to **DualStack** to create a dual-stack ALB instance.
 * > If you set **AddressIpVersion** to **DualStack**:
 * *   If you set **AddressType** to **Internet**, the ALB instance uses a public IPv4 IP address and a private IPv6 address.
 * *   If you set **AddressType** to **Intranet**, the ALB instance uses a private IPv4 IP address and a private IPv6 address.
 * ### Description
 * *   After the DisableLoadBalancerIpv6Internet operation is called, the value of **Ipv6AddressType** is changed to **Intranet** and the type of the IPv6 address of the ALB instance is changed from public to private. If you upgrade the instance or the instance scales elastic network interfaces (ENIs) along with workloads, private IPv6 addresses are automatically enabled for the instance and the new ENIs. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the value of **Ipv6AddressType**.
 * *   **DisableLoadBalancerIpv6Internet** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the status of the task.
 *     *   If the ALB instance is in the **Configuring** state, the network type of the IPv6 address that is used by the ALB instance is being changed.
 *     *   If the ALB instance is in the **Active** state, the network type of the IPv6 address that is used by the ALB instance is changed.
 *
 * @param request DisableLoadBalancerIpv6InternetRequest
 * @return DisableLoadBalancerIpv6InternetResponse
 */
async function disableLoadBalancerIpv6Internet(request: DisableLoadBalancerIpv6InternetRequest): DisableLoadBalancerIpv6InternetResponse {
  var runtime = new $RuntimeOptions{};
  return disableLoadBalancerIpv6InternetWithOptions(request, runtime);
}

model DissociateAclsFromListenerRequest {
  aclIds?: [ string ](name='AclIds', description='The access control list (ACL) IDs. You can disassociate at most three ACLs from a listener in each call.

This parameter is required.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
}

model DissociateAclsFromListenerResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DissociateAclsFromListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DissociateAclsFromListenerResponseBody(name='body'),
}

/**
 * @summary Disassociates access control lists (ACLs) from a listener.
 *
 * @description **DeleteDhcpOptionsSet** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAclRelations](https://help.aliyun.com/document_detail/213618.html) operation to query the status of the task.
 * *   If an ACL is in the **Dissociating** state, the ACL is being disassociated from the listener.
 * *   If an ACL is in the **Dissociated** state, the ACL is disassociated from the listener.
 *
 * @param request DissociateAclsFromListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DissociateAclsFromListenerResponse
 */
async function dissociateAclsFromListenerWithOptions(request: DissociateAclsFromListenerRequest, runtime: $RuntimeOptions): DissociateAclsFromListenerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aclIds)) {
    query['AclIds'] = request.aclIds;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DissociateAclsFromListener',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disassociates access control lists (ACLs) from a listener.
 *
 * @description **DeleteDhcpOptionsSet** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAclRelations](https://help.aliyun.com/document_detail/213618.html) operation to query the status of the task.
 * *   If an ACL is in the **Dissociating** state, the ACL is being disassociated from the listener.
 * *   If an ACL is in the **Dissociated** state, the ACL is disassociated from the listener.
 *
 * @param request DissociateAclsFromListenerRequest
 * @return DissociateAclsFromListenerResponse
 */
async function dissociateAclsFromListener(request: DissociateAclsFromListenerRequest): DissociateAclsFromListenerResponse {
  var runtime = new $RuntimeOptions{};
  return dissociateAclsFromListenerWithOptions(request, runtime);
}

model DissociateAdditionalCertificatesFromListenerRequest {
  certificates?: [ 
    {
      certificateId?: string(name='CertificateId', description='The certificate ID.

This parameter is required.', example='12315790343_166f8204689_1714763408_70998****'),
    }
  ](name='Certificates', description='The additional certificates. Only server certificates are supported. You can specify at most 20 certificates.

This parameter is required.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a **2xx HTTP** status code is returned and the operation is performed.', example='true'),
  listenerId?: string(name='ListenerId', description='The listener ID. You must specify the ID of an HTTPS listener or a QUIC listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
}

model DissociateAdditionalCertificatesFromListenerResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model DissociateAdditionalCertificatesFromListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DissociateAdditionalCertificatesFromListenerResponseBody(name='body'),
}

/**
 * @summary Disassociates additional certificates from a listener.
 *
 * @description **DissociateAdditionalCertificatesFromListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListListenerCertificates](https://help.aliyun.com/document_detail/214354.html) operation to query the status of the task. - If an additional certificate is in the **Dissociating** state, the additional certificate is being disassociated. - If an additional certificate is in the **Dissociated** state, the additional certificate is disassociated.
 *
 * @param request DissociateAdditionalCertificatesFromListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DissociateAdditionalCertificatesFromListenerResponse
 */
async function dissociateAdditionalCertificatesFromListenerWithOptions(request: DissociateAdditionalCertificatesFromListenerRequest, runtime: $RuntimeOptions): DissociateAdditionalCertificatesFromListenerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certificates)) {
    query['Certificates'] = request.certificates;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DissociateAdditionalCertificatesFromListener',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disassociates additional certificates from a listener.
 *
 * @description **DissociateAdditionalCertificatesFromListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListListenerCertificates](https://help.aliyun.com/document_detail/214354.html) operation to query the status of the task. - If an additional certificate is in the **Dissociating** state, the additional certificate is being disassociated. - If an additional certificate is in the **Dissociated** state, the additional certificate is disassociated.
 *
 * @param request DissociateAdditionalCertificatesFromListenerRequest
 * @return DissociateAdditionalCertificatesFromListenerResponse
 */
async function dissociateAdditionalCertificatesFromListener(request: DissociateAdditionalCertificatesFromListenerRequest): DissociateAdditionalCertificatesFromListenerResponse {
  var runtime = new $RuntimeOptions{};
  return dissociateAdditionalCertificatesFromListenerWithOptions(request, runtime);
}

model EnableDeletionProtectionRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**: (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='true'),
  resourceId?: string(name='ResourceId', description='The Application Load Balancer (ALB) instance ID.

This parameter is required.', example='re-atstuj3rtop****'),
}

model EnableDeletionProtectionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model EnableDeletionProtectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableDeletionProtectionResponseBody(name='body'),
}

/**
 * @summary Enables deletion protection for a resource.
 *
 * @param request EnableDeletionProtectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableDeletionProtectionResponse
 */
async function enableDeletionProtectionWithOptions(request: EnableDeletionProtectionRequest, runtime: $RuntimeOptions): EnableDeletionProtectionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'EnableDeletionProtection',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables deletion protection for a resource.
 *
 * @param request EnableDeletionProtectionRequest
 * @return EnableDeletionProtectionResponse
 */
async function enableDeletionProtection(request: EnableDeletionProtectionRequest): EnableDeletionProtectionResponse {
  var runtime = new $RuntimeOptions{};
  return enableDeletionProtectionWithOptions(request, runtime);
}

model EnableLoadBalancerAccessLogRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

>  If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.

This parameter is required.', example='alb-bd6oylbckp6k9x****'),
  logProject?: string(name='LogProject', description='The project to which the access log is shipped.

This parameter is required.', example='sls-setter'),
  logStore?: string(name='LogStore', description='The Logstore to which the access log is shipped.

This parameter is required.', example='test'),
}

model EnableLoadBalancerAccessLogResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous job.', example='ff7713ca-5818-4120-85e3-0bf9fr******'),
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FD******'),
}

model EnableLoadBalancerAccessLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableLoadBalancerAccessLogResponseBody(name='body'),
}

/**
 * @summary Enables the access log feature for an Application Load Balancer (ALB) instance.
 *
 * @param request EnableLoadBalancerAccessLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableLoadBalancerAccessLogResponse
 */
async function enableLoadBalancerAccessLogWithOptions(request: EnableLoadBalancerAccessLogRequest, runtime: $RuntimeOptions): EnableLoadBalancerAccessLogResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.logProject)) {
    query['LogProject'] = request.logProject;
  }
  if (!$isNull(request.logStore)) {
    query['LogStore'] = request.logStore;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'EnableLoadBalancerAccessLog',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables the access log feature for an Application Load Balancer (ALB) instance.
 *
 * @param request EnableLoadBalancerAccessLogRequest
 * @return EnableLoadBalancerAccessLogResponse
 */
async function enableLoadBalancerAccessLog(request: EnableLoadBalancerAccessLogRequest): EnableLoadBalancerAccessLogResponse {
  var runtime = new $RuntimeOptions{};
  return enableLoadBalancerAccessLogWithOptions(request, runtime);
}

model EnableLoadBalancerIpv6InternetRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**(default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.

This parameter is required.', example='alb-o2cvudgo6rlqz7****'),
}

model EnableLoadBalancerIpv6InternetResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='4a6e3ad4-ef08-4ab1-b332-fa621cfe****'),
  requestId?: string(name='RequestId', description='The request ID.', example='BB920797-D70E-567F-8098-55A861DD7912'),
}

model EnableLoadBalancerIpv6InternetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableLoadBalancerIpv6InternetResponseBody(name='body'),
}

/**
 * @summary Changes the type of the IPv6 address that is used by a dual-stack Application Load Balancer (ALB) instance from private to public.
 *
 * @description ### Prerequisites
 * An ALB instance is created and IPv4/IPv6 dual stack is enabled for the instance. You can call the [CreateLoadBalancer](https://help.aliyun.com/document_detail/214358.html) operation and set **AddressIpVersion** to **DualStack** to create a dual-stack ALB instance.
 * > If you set **AddressIpVersion** to **DualStack**:
 * *   If you set **AddressType** to **Internet**, the ALB instance uses a public IPv4 IP address and a private IPv6 address.
 * *   If you set **AddressType** to **Intranet**, the ALB instance uses a private IPv4 IP address and a private IPv6 address.
 * ### Description
 * *   After the EnableLoadBalancerIpv6Internet operation is called, the value of **Ipv6AddressType** is changed to **Internet** and the type of the IPv6 address of the ALB instance is changed from private to public. If you upgrade the instance or the instance scales elastic network interfaces (ENIs) along with workloads, public IPv6 addresses are automatically enabled for the instance and the new ENIs. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the value of **Ipv6AddressType**.
 * *   **EnableLoadBalancerIpv6Internet** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the status of the task.
 *     *   If the ALB instance is in the **Configuring** state, the network type of the IPv6 address that is used by the ALB instance is being changed.
 *     *   If the ALB instance is in the **Active** state, the network type of the IPv6 address that is used by the ALB instance is changed.
 *
 * @param request EnableLoadBalancerIpv6InternetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableLoadBalancerIpv6InternetResponse
 */
async function enableLoadBalancerIpv6InternetWithOptions(request: EnableLoadBalancerIpv6InternetRequest, runtime: $RuntimeOptions): EnableLoadBalancerIpv6InternetResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'EnableLoadBalancerIpv6Internet',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the type of the IPv6 address that is used by a dual-stack Application Load Balancer (ALB) instance from private to public.
 *
 * @description ### Prerequisites
 * An ALB instance is created and IPv4/IPv6 dual stack is enabled for the instance. You can call the [CreateLoadBalancer](https://help.aliyun.com/document_detail/214358.html) operation and set **AddressIpVersion** to **DualStack** to create a dual-stack ALB instance.
 * > If you set **AddressIpVersion** to **DualStack**:
 * *   If you set **AddressType** to **Internet**, the ALB instance uses a public IPv4 IP address and a private IPv6 address.
 * *   If you set **AddressType** to **Intranet**, the ALB instance uses a private IPv4 IP address and a private IPv6 address.
 * ### Description
 * *   After the EnableLoadBalancerIpv6Internet operation is called, the value of **Ipv6AddressType** is changed to **Internet** and the type of the IPv6 address of the ALB instance is changed from private to public. If you upgrade the instance or the instance scales elastic network interfaces (ENIs) along with workloads, public IPv6 addresses are automatically enabled for the instance and the new ENIs. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the value of **Ipv6AddressType**.
 * *   **EnableLoadBalancerIpv6Internet** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the status of the task.
 *     *   If the ALB instance is in the **Configuring** state, the network type of the IPv6 address that is used by the ALB instance is being changed.
 *     *   If the ALB instance is in the **Active** state, the network type of the IPv6 address that is used by the ALB instance is changed.
 *
 * @param request EnableLoadBalancerIpv6InternetRequest
 * @return EnableLoadBalancerIpv6InternetResponse
 */
async function enableLoadBalancerIpv6Internet(request: EnableLoadBalancerIpv6InternetRequest): EnableLoadBalancerIpv6InternetResponse {
  var runtime = new $RuntimeOptions{};
  return enableLoadBalancerIpv6InternetWithOptions(request, runtime);
}

model GetHealthCheckTemplateAttributeRequest {
  healthCheckTemplateId?: string(name='HealthCheckTemplateId', description='The ID of the health check template.

This parameter is required.', example='hct-x4jazoyi6tvsq9****'),
}

model GetHealthCheckTemplateAttributeResponseBody = {
  healthCheckCodes?: [ string ](name='HealthCheckCodes', description='The HTTP status codes that indicate a healthy backend server.'),
  healthCheckConnectPort?: int32(name='HealthCheckConnectPort', description='The port that is used for health checks.

Valid values: **0** to **65535**.', example='80'),
  healthCheckHost?: string(name='HealthCheckHost', description='The domain name that is used for health checks. Valid values:

*   **$SERVER_IP**: the private IP addresses of backend servers. If an IP address is specified, or this parameter is not specified, the ALB instance uses the private IP addresses of backend servers as domain names for health checks.
*   **domain**: The domain name must be 1 to 80 characters in length, and can contain letters, digits, periods (.), and hyphens (-).

>  This parameter takes effect only if `HealthCheckProtocol` is set to **HTTP** or **HTTPS**.', example='$SERVER_IP'),
  healthCheckHttpVersion?: string(name='HealthCheckHttpVersion', description='The HTTP version for health checks.

Valid values: **HTTP1.0** and **HTTP1.1**.

>  This parameter takes effect only if you set `HealthCheckProtocol` to **HTTP** or **HTTPS**.', example='HTTP1.0'),
  healthCheckInterval?: int32(name='HealthCheckInterval', description='The interval at which health checks are performed. Unit: seconds. Valid values: **1 to 50**.', example='3'),
  healthCheckMethod?: string(name='HealthCheckMethod', description='The HTTP method that is used for health checks. Valid values:

*   **HEAD** (default): By default, HTTP and HTTPS health checks use the HEAD method.
*   **GET**: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.
*   **POST**: gRPC health checks use the POST method by default.

>  This parameter takes effect only if you set **HealthCheckProtocol** to **HTTP**, **HTTPS**, or **gRPC**.', example='GET'),
  healthCheckPath?: string(name='HealthCheckPath', description='The URL that is used for health checks.

The URL must be 1 to 80 characters in length, and can contain letters, digits, the following special characters: - / . % ? # &, and the following extended characters: `_ ; ~ ! ( ) * [ ] @ $ ^ : \\\\" , +`. The URL must start with a forward slash (/).

>  This parameter takes effect only if you set **HealthCheckProtocol** to **HTTP**, **HTTPS**, or **gRPC**.', example='/test/index.html'),
  healthCheckProtocol?: string(name='HealthCheckProtocol', description='The protocol that is used for health checks. Valid values:

*   **HTTP** (default): HTTP health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers.
*   **HTTPS**: The ALB instance sends HEAD or GET requests, which simulate browser requests, to check whether the backend server is healthy. HTTPS supports encryption and provides higher security than HTTP.
*   **TCP**: TCP health checks send TCP SYN packets to a backend server to probe the availability of backend servers.
*   **gRPC**: gRPC health checks send POST or GET requests to a backend server to probe the availability of backend servers.', example='HTTP'),
  healthCheckTemplateId?: string(name='HealthCheckTemplateId', description='The ID of the health check template.', example='hct-x4jazoyi6tvsq9****'),
  healthCheckTemplateName?: string(name='HealthCheckTemplateName', description='The name of the health check template.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='HealthCheckTemplate1'),
  healthCheckTimeout?: int32(name='HealthCheckTimeout', description='The timeout period of a health check response. If a backend server does not respond within the specified timeout period, the backend server is declared unhealthy. Unit: seconds.

Valid values: **1** to **300**.', example='200'),
  healthyThreshold?: int32(name='HealthyThreshold', description='The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status is changed from **fail** to **success**.

Valid values: **2** to **10**.', example='5'),
  requestId?: string(name='RequestId', description='The request ID.', example='DB1AFC33-DAE8-528E-AA4D-4A6AABE71945'),
  resourceGroupId?: string(name='ResourceGroupId'),
  tags?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length, and cannot contain `http://` or `https://`. The tag key cannot start with `acs:` or `aliyun`.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length, and cannot start with `acs:`. The tag value cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tags', description='The tags.'),
  unhealthyThreshold?: int32(name='UnhealthyThreshold', description='The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status is changed from **success** to **fail**.

Valid values: **2** to **10**.', example='5'),
}

model GetHealthCheckTemplateAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHealthCheckTemplateAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details about a health check template.
 *
 * @param request GetHealthCheckTemplateAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHealthCheckTemplateAttributeResponse
 */
async function getHealthCheckTemplateAttributeWithOptions(request: GetHealthCheckTemplateAttributeRequest, runtime: $RuntimeOptions): GetHealthCheckTemplateAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.healthCheckTemplateId)) {
    query['HealthCheckTemplateId'] = request.healthCheckTemplateId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetHealthCheckTemplateAttribute',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details about a health check template.
 *
 * @param request GetHealthCheckTemplateAttributeRequest
 * @return GetHealthCheckTemplateAttributeResponse
 */
async function getHealthCheckTemplateAttribute(request: GetHealthCheckTemplateAttributeRequest): GetHealthCheckTemplateAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return getHealthCheckTemplateAttributeWithOptions(request, runtime);
}

model GetListenerAttributeRequest {
  listenerId?: string(name='ListenerId', description='The listener ID.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
}

model GetListenerAttributeResponseBody = {
  aclConfig?: {
    aclRelations?: [ 
      {
        aclId?: string(name='AclId', description='The ID of the ACL that is associated with the listener.', example='acl-doc****'),
        status?: string(name='Status', description='Indicates whether the ACL is associated with the listener. Valid values:

*   **Associating**
*   **Associated**
*   **Dissociating**', example='Associating'),
      }
    ](name='AclRelations', description='The IDs of the ACLs that are associated with the listener.'),
    aclType?: string(name='AclType', description='The type of the ACL. Valid values:

*   **White**: a whitelist. Only requests from the IP addresses or CIDR blocks in the network ACL are forwarded. Whitelists are applicable to scenarios in which you want to allow only specific IP addresses to access an application. Your service may be adversely affected if the whitelist is not properly configured. If a whitelist is configured for a listener, only requests from IP addresses that are on the whitelist are forwarded by the listener.

    If you enable a whitelist but do not add an IP address to the whitelist, the listener forwards all requests.

*   **Black**: a blacklist. Requests from the IP addresses or CIDR blocks in the network ACL are denied. Blacklists are suitable for scenarios in which you want to deny access from specific IP addresses or CIDR blocks to an application.

    If a blacklist is configured for a listener but no IP addresses are added to the blacklist, the listener forwards all requests.', example='White'),
  }(name='AclConfig', description='The configurations of the access control lists (ACLs).'),
  caCertificates?: [ 
    {
      certificateId?: string(name='CertificateId', description='The ID of the default CA certificate.', example='139a00604bd-cn-east-hangzho****'),
      isDefault?: boolean(name='IsDefault', description='Indicates whether the certificate is a default certificate: Valid values:

*   **true**
*   **false**', example='true'),
      status?: string(name='Status', description='The status of the certificate.', example='Associated'),
    }
  ](name='CaCertificates', description='A list of default CA certificates.'),
  caEnabled?: boolean(name='CaEnabled', description='Indicates whether mutual authentication is enabled. Valid values:

*   **true**
*   **false**', example='false'),
  certificates?: [ 
    {
      certificateId?: string(name='CertificateId', description='The ID of the certificate. Only server certificates are supported.', example='12315790212_166f8204689_1714763408_70998****'),
    }
  ](name='Certificates', description='A list of certificates.'),
  defaultActions?: [ 
    {
      forwardGroupConfig?: {
        serverGroupTuples?: [ 
          {
            serverGroupId?: string(name='ServerGroupId', description='The ID of the server group to which requests are forwarded.', example='rsp-cige6j****'),
          }
        ](name='ServerGroupTuples', description='The server group to which requests are forwarded.'),
      }(name='ForwardGroupConfig', description='The configuration of the ForwardGroup action. This parameter is returned and takes effect when Type is set to **ForwardGroup**.'),
      type?: string(name='Type', description='The type of the action.

If **ForwardGroup** is returned, requests are forwarded to multiple vServer groups.', example='ForwardGroup'),
    }
  ](name='DefaultActions', description='The actions of the default forwarding rule.'),
  gzipEnabled?: boolean(name='GzipEnabled', description='Indicates whether GZIP compression is enabled to compress specific types of files. Valid values:

*   **true**
*   **false**', example='true'),
  http2Enabled?: boolean(name='Http2Enabled', description='Indicates whether HTTP/2 is enabled. Valid values:

*   **true**
*   **false**

> This parameter is available only when you create an HTTPS listener.', example='true'),
  idleTimeout?: int32(name='IdleTimeout', description='The timeout period of an idle connection. Unit: seconds.

If no requests are received within the specified timeout period, Application Load Balancer (ALB) closes the current connection. When a request is received, ALB establishes a new connection.', example='2'),
  listenerDescription?: string(name='ListenerDescription', description='The name of the listener.', example='test'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsr-bp1bpn0kn908w4nbw****'),
  listenerPort?: int32(name='ListenerPort', description='The frontend port that is used by the ALB instance.', example='80'),
  listenerProtocol?: string(name='ListenerProtocol', description='The listener protocol. Valid values: **HTTP**, **HTTPS**, and **QUIC**.', example='HTTP'),
  listenerStatus?: string(name='ListenerStatus', description='The status of the listener. Valid values:

*   **Provisioning**
*   **Running**
*   **Configuring**
*   **Stopped**', example='Running'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.', example='lb-bp1o94dp5i6ea****'),
  logConfig?: {
    accessLogRecordCustomizedHeadersEnabled?: boolean(name='AccessLogRecordCustomizedHeadersEnabled', description='Indicates whether custom headers are recorded in the access log. Valid values:

*   **true**
*   **false**', example='true'),
    accessLogTracingConfig?: {
      tracingEnabled?: boolean(name='TracingEnabled', description='Indicates whether Xtrace is enabled. Valid values:

*   **true**
*   **false**

> You can set this parameter to **true** only if the AccessLogEnabled parameter is set to true.', example='true'),
      tracingSample?: int32(name='TracingSample', description='The sampling rate of Xtrace. Valid values: 1 to 10000.

> If **TracingEnabled** is set to **true**, this parameter is valid.', example='100'),
      tracingType?: string(name='TracingType', description='The Xtrace type. Supported Xtrace type: **Zipkin**.

> If **TracingEnabled** is set to **true**, this parameter is valid.', example='Zipkin'),
    }(name='AccessLogTracingConfig', description='The configuration of Xtrace. Xtrace is used to record requests sent to ALB.'),
  }(name='LogConfig', description='The logging configuration.'),
  quicConfig?: {
    quicListenerId?: string(name='QuicListenerId', description='The ID of the QUIC listener. This parameter is returned when **QuicUpgradeEnabled** is set to **true**. Only HTTPS listeners support this parameter.

> You must associate the HTTPS listener and the QUIC listener with the same ALB instance. In addition, make sure that the QUIC listener has never been associated with another listener.', example='lsn-333'),
    quicUpgradeEnabled?: boolean(name='QuicUpgradeEnabled', description='Indicates whether QUIC upgrade is enabled. Valid values:

*   **true**
*   **false**

> Only HTTPS listeners support this parameter.', example='true'),
  }(name='QuicConfig', description='The configuration information when the listener is associated with a QUIC listener.'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
  requestTimeout?: int32(name='RequestTimeout', description='The timeout period of a request. Unit: seconds.

If no responses are received from the backend server within the specified timeout period, ALB returns an `HTTP 504` error code to the client.', example='34'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The security policy.

> This parameter is available only when you create an HTTPS listener.', example='tls_cipher_policy_1_1'),
  tags?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tags', description='The tags.'),
  XForwardedForConfig?: {
    XForwardedForClientCertClientVerifyAlias?: string(name='XForwardedForClientCertClientVerifyAlias', description='The name of the custom header. This parameter takes effect only when **XForwardedForClientCertClientVerifyEnabled** is set to **true**.

The name is 1 to 40 characters in length, and can contain lowercase letters, hyphens (-), underscores (_), and digits.

> This parameter is available only when you create an HTTPS listener.', example='test_client-verify-alias_123456'),
    XForwardedForClientCertClientVerifyEnabled?: boolean(name='XForwardedForClientCertClientVerifyEnabled', description='Indicates whether the `X-Forwarded-Clientcert-clientverify` header is used to retrieve the verification result of the client certificate. Valid values:

*   **true**
*   **false**

> This parameter is available only when you create an HTTPS listener.', example='true'),
    XForwardedForClientCertFingerprintAlias?: string(name='XForwardedForClientCertFingerprintAlias', description='The name of the custom header. This parameter takes effect only when **XForwardedForClientCertFingerprintEnabled** is set to **true**.

The name is 1 to 40 characters in length, and can contain lowercase letters, hyphens (-), underscores (_), and digits.

> This parameter is available only when you create an HTTPS listener.', example='test_finger-print-alias_123456'),
    XForwardedForClientCertFingerprintEnabled?: boolean(name='XForwardedForClientCertFingerprintEnabled', description='Indicates whether the `X-Forwarded-Clientcert-fingerprint` header is used to retrieve the fingerprint of the client certificate. Valid values:

*   **true**
*   **false**

> This parameter is available only when you create an HTTPS listener.', example='true'),
    XForwardedForClientCertIssuerDNAlias?: string(name='XForwardedForClientCertIssuerDNAlias', description='The name of the custom header. This parameter takes effect only when **XForwardedForClientCertIssuerDNEnabled** is set to **true**.

The name is 1 to 40 characters in length, and can contain lowercase letters, hyphens (-), underscores (_), and digits.

> This parameter is available only when you create an HTTPS listener.', example='test_issue-dn-alias_123456'),
    XForwardedForClientCertIssuerDNEnabled?: boolean(name='XForwardedForClientCertIssuerDNEnabled', description='Indicates whether the `X-Forwarded-Clientcert-issuerdn` header is used to retrieve information about the authority that issues the client certificate. Valid values:

*   **true**
*   **false**

> This parameter is available only when you create an HTTPS listener.', example='true'),
    XForwardedForClientCertSubjectDNAlias?: string(name='XForwardedForClientCertSubjectDNAlias', description='The name of the custom header. This parameter takes effect only when **XForwardedForClientCertSubjectDNEnabled** is set to **true**.

The name is 1 to 40 characters in length, and can contain lowercase letters, hyphens (-), underscores (_), and digits.

> This parameter is available only when you create an HTTPS listener.', example='test_subject-dn-alias_123456'),
    XForwardedForClientCertSubjectDNEnabled?: boolean(name='XForwardedForClientCertSubjectDNEnabled', description='Indicates whether the `X-Forwarded-Clientcert-subjectdn` header is used to retrieve information about the owner of the client certificate. Valid values:

*   **true**
*   **false**

> This parameter is available only when you create an HTTPS listener.', example='true'),
    XForwardedForClientSourceIpsEnabled?: boolean(name='XForwardedForClientSourceIpsEnabled', description='Indicates whether the `X-Forwarded-Client-Ip` header is used to retrieve the source port of the ALB instance. Valid values:

*   **true**
*   **false**

> This parameter is available only when you create an HTTP, HTTPS, or QUIC listener.', example='false'),
    XForwardedForClientSourceIpsTrusted?: string(name='XForwardedForClientSourceIpsTrusted', description='The trusted proxy IP address.

ALB traverses `X-Forwarded-For` backward and selects the first IP address that is not on the trusted IP address list as the real IP address of the client. The IP address is used in source IP address throttling.', example='10.1.1.0/24'),
    XForwardedForClientSrcPortEnabled?: boolean(name='XForwardedForClientSrcPortEnabled', description='Indicates whether the `X-Forwarded-Client-Port` header is used to retrieve the client port. Valid values:

*   **true**
*   **false**

> This parameter is available only when you create an HTTP or HTTPS listener.', example='true'),
    XForwardedForEnabled?: boolean(name='XForwardedForEnabled', description='Indicates whether the `X-Forwarded-For` header is used to retrieve the client IP address. Valid values:

*   **true** (default)
*   **false**

> *   If this parameter is set to **true**, the default value of the **XForwardedForProcessingMode** parameter is **append**. You can change it to **remove**.
> *   If this parameter is set to **false**, the `X-Forwarded-For` header in the request is not modified in any way before the request is sent to backend servers.
> *   This parameter is only available for HTTP and HTTPS listeners.', example='true'),
    XForwardedForHostEnabled?: boolean(name='XForwardedForHostEnabled', description='Specifies whether to use the `X-Forwarded-Host` header to retrieve the client domain name. Valid values:

*   **true**
*   **false** (default)

>  This parameter is available for HTTP, HTTPS, and QUIC listeners.', example='false'),
    XForwardedForProcessingMode?: string(name='XForwardedForProcessingMode', description='Specifies how the `X-Forwarded-For` header is processed. This parameter takes effect only when **XForwardedForEnabled** is set to **true**. Valid values:

*   **append** (default)
*   **remove**

> *   If this parameter is set to **append**, ALB appends the IP address of the last hop to the existing `X-Forwarded-For` header in the request before the request is sent to backend servers.
> *   If this parameter is set to **remove**, ALB removes the `X-Forwarded-For` header in the request before the request is sent to backend servers, no matter whether the request carries the `X-Forwarded-For` header.
> *   This parameter is only available for HTTP and HTTPS listeners.', example='append'),
    XForwardedForProtoEnabled?: boolean(name='XForwardedForProtoEnabled', description='Indicates whether the `X-Forwarded-Proto` header is used to retrieve the listening protocol. Valid values:

*   **true**
*   **false**

> This parameter is available only when you create an HTTP, HTTPS, or QUIC listener.', example='true'),
    XForwardedForSLBIdEnabled?: boolean(name='XForwardedForSLBIdEnabled', description='Indicates whether the `SLB-ID` header is used to retrieve the ID of the CLB instance. Valid values:

*   **true**
*   **false**

> This parameter is available only when you create an HTTP, HTTPS, or QUIC listener.', example='true'),
    XForwardedForSLBPortEnabled?: boolean(name='XForwardedForSLBPortEnabled', description='Indicates whether the `X-Forwarded-Port` header is used to retrieve the listening port of the ALB instance. Valid values:

*   **true**
*   **false**

> This parameter is available only when you create an HTTP, HTTPS, or QUIC listener.', example='true'),
  }(name='XForwardedForConfig', description='The configuration of the XForward headers.'),
}

model GetListenerAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetListenerAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details about a listener.
 *
 * @param request GetListenerAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetListenerAttributeResponse
 */
async function getListenerAttributeWithOptions(request: GetListenerAttributeRequest, runtime: $RuntimeOptions): GetListenerAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetListenerAttribute',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details about a listener.
 *
 * @param request GetListenerAttributeRequest
 * @return GetListenerAttributeResponse
 */
async function getListenerAttribute(request: GetListenerAttributeRequest): GetListenerAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return getListenerAttributeWithOptions(request, runtime);
}

model GetListenerHealthStatusRequest {
  includeRule?: boolean(name='IncludeRule', description='Specifies whether to return the health check results of forwarding rules. Valid values:

*   **true**
*   **false** (default)', example='true'),
  listenerId?: string(name='ListenerId', description='The listener ID.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  maxResults?: long(name='MaxResults', description='The number of entries to return on each page. Valid values: **1** to **30**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The token that determines the start point of the query. Valid values:

*   If this is your first query or no next queries are to be sent, ignore this parameter.
*   If a next query is to be sent, set the value to the value of **NextToken** that is returned from the last call.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
}

model GetListenerHealthStatusResponseBody = {
  listenerHealthStatus?: [ 
    {
      listenerId?: string(name='ListenerId', description='The listener ID.', example='lsr-bp1bpn0kn908w4nbw****'),
      listenerPort?: int32(name='ListenerPort', description='The listener port.', example='80'),
      listenerProtocol?: string(name='ListenerProtocol', description='The listener protocol.', example='http'),
      serverGroupInfos?: [ 
        {
          actionType?: string(name='ActionType', description='The action specified for the server group. Valid values:

*   **ForwardGroup**: distributes requests to server groups.
*   **TrafficMirror**: mirrors requests to server groups.', example='TrafficMirror'),
          healthCheckEnabled?: string(name='HealthCheckEnabled', description='Indicates whether health checks are enabled. If **on** is returned, it indicates that health checks are enabled.', example='on'),
          nonNormalServers?: [ 
            {
              port?: int32(name='Port', description='The backend port.', example='90'),
              reason?: {
                actualResponse?: string(name='ActualResponse', description='The HTTP status code returned from the server, for example, **302**.

> A value is returned only if `ReasonCode` is set to **RESPONSE_MISMATCH**.', example='302'),
                expectedResponse?: string(name='ExpectedResponse', description='The HTTP status code returned after backend servers pass health checks.

Valid values: **HTTP_2xx**, **HTTP_3xx**, **HTTP_4xx**, and **HTTP_5xx**. Multiple status codes are separated by commas (,).

> This value is returned only if **ReasonCode** is set to **RESPONSE_MISMATCH**.', example='HTTP_2xx'),
                reasonCode?: string(name='ReasonCode', description='The reason why the value of **Status** is Unhealthy. Only HTTP and HTTPS listeners support this parameter.

*   **CONNECT_TIMEOUT**: ALB failed to connect to the backend server within the specified period of time.
*   **CONNECT_FAILED**: ALB failed to connect to the backend server.
*   **RECV_RESPONSE_FAILED**: ALB failed to receive a response from the backend server.
*   **RECV_RESPONSE_TIMEOUT**: ALB failed to receive a response from the backend server within the specified period of time.
*   **SEND_REQUEST_FAILED**: ALB failed to send a request to the backend server.
*   **SEND_REQUEST_TIMEOUT**: ALB failed to send a request to the backend server within the specified period of time.
*   **RESPONSE_FORMAT_ERROR**: The format of the response from the backend server is invalid.
*   **RESPONSE_FORMAT_ERROR**: The HTTP status code returned from the backend server is not the expected one.', example='RESPONSE_MISMATCH'),
              }(name='Reason', description='The cause of the abnormal state.'),
              serverId?: string(name='ServerId', description='The ID of the backend server.', example='rg-bp1bfa08ex*****'),
              serverIp?: string(name='ServerIp', description='The IP address of the backend server.', example='192.168.8.10'),
              status?: string(name='Status', description='The status of the health check. Valid values: Valid values:

*   **Initial**: indicates that health checks are configured for the NLB instance, but no data was found.
*   **Unhealthy**: indicates that the backend server consecutively fails health checks.
*   **Unused**: indicates that the weight of the backend server is 0.
*   **Unavailable**: indicates that health checks are disabled.', example='Initial'),
            }
          ](name='NonNormalServers', description='A list of unhealthy backend servers.'),
          serverGroupId?: string(name='ServerGroupId', description='The ID of the server group that is associated with the listener.', example='vsp-bp1qjwo61pqz3ahltv****'),
        }
      ](name='ServerGroupInfos', description='The information about the server group.'),
    }
  ](name='ListenerHealthStatus', description='The health check status of the server groups that are associated with the listener.'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If **NextToken** was returned in the previous query, specify the value to obtain the next set of results.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  ruleHealthStatus?: [ 
    {
      ruleId?: string(name='RuleId', description='The ID of the forwarding rule.', example='rule-hp34s2h0xx1ht4nwo****'),
      serverGroupInfos?: [ 
        {
          actionType?: string(name='ActionType', description='The action specified for the server group.', example='TrafficMirror'),
          healthCheckEnabled?: string(name='HealthCheckEnabled', description='Indicates whether health checks are enabled. If **on** is returned, it indicates that health checks are enabled.', example='on'),
          nonNormalServers?: [ 
            {
              port?: int32(name='Port', description='The backend port.', example='90'),
              reason?: {
                actualResponse?: string(name='ActualResponse', description='The HTTP status code returned from the server, for example, **302**.

> A value is returned only if **ReasonCode** is set to **RESPONSE_MISMATCH**.', example='302'),
                expectedResponse?: string(name='ExpectedResponse', description='The HTTP status code returned after backend servers pass health checks.

Valid values: **HTTP_2xx**, **HTTP_3xx**, **HTTP_4xx**, and **HTTP_5xx**. Multiple status codes are separated by commas (,).

> A value is returned only if **ReasonCode** is set to **RESPONSE_MISMATCH**.', example='HTTP_2xx'),
                reasonCode?: string(name='ReasonCode', description='The reason why the value of **Status** is Unhealthy. Only HTTP and HTTPS listeners support this parameter.

*   **CONNECT_TIMEOUT**: ALB failed to connect to the backend server within the specified period of time.
*   **CONNECT_FAILED**: ALB failed to connect to the backend server.
*   **RECV_RESPONSE_FAILED**: ALB failed to receive a response from the backend server.
*   **RECV_RESPONSE_TIMEOUT**: ALB failed to receive a response from the backend server within the specified period of time.
*   **SEND_REQUEST_FAILED**: ALB failed to send a request to the backend server.
*   **SEND_REQUEST_TIMEOUT**: ALB failed to send a request to the backend server within the specified period of time.
*   **RESPONSE_FORMAT_ERROR**: The format of the response from the backend server is invalid.
*   **RESPONSE_FORMAT_ERROR**: The HTTP status code returned from the backend server is not the expected one.', example='RESPONSE_MISMATCH'),
              }(name='Reason', description='The cause of the abnormal state.'),
              serverId?: string(name='ServerId', description='The ID of the backend server.', example='rg-bp1bfa08ex****'),
              serverIp?: string(name='ServerIp', description='The IP address of the server group.', example='192.168.2.11'),
              status?: string(name='Status', description='The status of the health check. Valid values: Valid values:

*   **Initial**: indicates that health checks are configured for the NLB instance, but no data was found.
*   **Unhealthy**: indicates that the backend server consecutively fails health checks.
*   **Unused**: indicates that the weight of the backend server is 0.
*   **Unavailable**: indicates that health checks are disabled.', example='Initial'),
            }
          ](name='NonNormalServers', description='A list of unhealthy backend servers.'),
          serverGroupId?: string(name='ServerGroupId', description='The ID of the server group that is associated with the listener.', example='vsp-bp1qjwo61pqz3ahlt****'),
        }
      ](name='ServerGroupInfos', description='The server groups.'),
    }
  ](name='RuleHealthStatus', description='The health check status of the forwarding rules.'),
}

model GetListenerHealthStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetListenerHealthStatusResponseBody(name='body'),
}

/**
 * @summary Queries the health check status of a listener and its forwarding rules.
 *
 * @param request GetListenerHealthStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetListenerHealthStatusResponse
 */
async function getListenerHealthStatusWithOptions(request: GetListenerHealthStatusRequest, runtime: $RuntimeOptions): GetListenerHealthStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.includeRule)) {
    query['IncludeRule'] = request.includeRule;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetListenerHealthStatus',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the health check status of a listener and its forwarding rules.
 *
 * @param request GetListenerHealthStatusRequest
 * @return GetListenerHealthStatusResponse
 */
async function getListenerHealthStatus(request: GetListenerHealthStatusRequest): GetListenerHealthStatusResponse {
  var runtime = new $RuntimeOptions{};
  return getListenerHealthStatusWithOptions(request, runtime);
}

model GetLoadBalancerAttributeRequest {
  loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.

This parameter is required.', example='alb-o9ulmq5hgn68jk****'),
}

model GetLoadBalancerAttributeResponseBody = {
  accessLogConfig?: {
    logProject?: string(name='LogProject', description='The Log Service project.', example='sls-setter'),
    logStore?: string(name='LogStore', description='The Logstore.', example='test'),
  }(name='AccessLogConfig', description='The configuration of the access log feature.'),
  addressAllocatedMode?: string(name='AddressAllocatedMode', description='The mode in which IP addresses are allocated. Valid values:

*   **Fixed**: allocates a static IP address to the ALB instance.
*   **Dynamic**: dynamically allocates an IP address to each zone of the ALB instance.', example='Dynamic'),
  addressIpVersion?: string(name='AddressIpVersion', description='The IP version. Valid values:

*   **IPv4**
*   **DualStack**', example='DualStack'),
  addressType?: string(name='AddressType', description='The network type of the ALB instance. Valid values:

*   **Internet**: The ALB instance uses a public IP address. The domain name of the ALB instance is resolved to the public IP address. Therefore, the ALB instance can be accessed over the Internet.
*   **Intranet**: The ALB instance uses a private IP address. The domain name of the ALB instance is resolved to the private IP address. In this case, the ALB instance can be accessed over the virtual private cloud (VPC) where the ALB instance is deployed.', example='Intranet'),
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the elastic IP address (EIP) bandwidth plan that is associated with the Internet-facing ALB instance.', example='cbwp-bp1vevu8h3ieh****'),
  createTime?: string(name='CreateTime', description='The time when the resource was created. The time follows the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time is displayed in UTC.', example='2022-07-02T02:49:05Z'),
  DNSName?: string(name='DNSName', description='The domain name of the ALB instance.', example='alb-95qnr2itwu9orb****.cn-hangzhou.alb.aliyuncs.com'),
  deletionProtectionConfig?: {
    enabled?: boolean(name='Enabled', description='Indicates whether the deletion protection feature is enabled. Valid values:

*   **true**
*   **false**', example='true'),
    enabledTime?: string(name='EnabledTime', description='The time when the deletion protection feature was enabled. The time follows the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time is displayed in UTC.', example='2022-08-02T02:49:05Z'),
  }(name='DeletionProtectionConfig', description='The configuration of deletion protection.'),
  ipv6AddressType?: string(name='Ipv6AddressType', description='The type of IPv6 address that is used by the ALB instance. Valid values:

*   **Internet**: The ALB instance uses a public IP address. The domain name of the ALB instance is resolved to the public IP address. Therefore, the ALB instance can be accessed over the Internet.
*   **Intranet**: The ALB instance uses a private IP address. The domain name of the ALB instance is resolved to the private IP address. Therefore, the ALB instance can be accessed over the VPC in which the ALB instance is deployed.', example='Intranet'),
  loadBalancerBillingConfig?: {
    payType?: string(name='PayType', description='The billing method.

Only **PostPay** is returned, which indicates the pay-as-you-go billing method.', example='PostPay'),
  }(name='LoadBalancerBillingConfig', description='The billing method of the ALB instance.'),
  loadBalancerBussinessStatus?: string(name='LoadBalancerBussinessStatus', description='The service status of the ALB instance. Valid values:

*   **Abnormal**
*   **Normal**', example='Normal'),
  loadBalancerEdition?: string(name='LoadBalancerEdition', description='The edition of the ALB instance. The features and billing rules vary based on the edition of the ALB instance. Valid values:

*   **Basic**
*   **Standard**
*   **StandardWithWaf**', example='Standard'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.', example='alb-o9ulmq5hgn68jk****'),
  loadBalancerName?: string(name='LoadBalancerName', description='The name of the ALB instance.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='alb1'),
  loadBalancerOperationLocks?: [ 
    {
      lockReason?: string(name='LockReason', description='The reason why the ALB instance is locked. This parameter is valid only if **LoadBalancerBussinessStatus** is set to **Abnormal**.', example='nolock'),
      lockType?: string(name='LockType', description='The lock type. Valid values:

*   **SecurityLocked**: The ALB instance is locked due to security reasons.
*   **RelatedResourceLocked**: The ALB instance is locked due to other resources that are associated with the ALB instance.
*   **FinancialLocked**: The ALB instance is locked due to overdue payments.
*   **ResidualLocked**: The ALB instance is locked because the associated resources have overdue payments and the resources are released.', example='FinancialLocked'),
    }
  ](name='LoadBalancerOperationLocks', description='The type of the lock. Valid values:

*   **SecurityLocked**: The ALB instance is locked due to security reasons.
*   **RelatedResourceLocked**: The ALB instance is locked due to association issues.
*   **FinancialLocked**: The ALB instance is locked due to overdue payments.
*   **ResidualLocked**: The ALB instance is locked because the associated resources have overdue payments and the resources are released.'),
  loadBalancerStatus?: string(name='LoadBalancerStatus', description='The status of the ALB instance. Valid values:

*   **Inactive**: The ALB instance is disabled. ALB instances in the Inactive state do not forward traffic.
*   **Active**: The ALB instance is running.
*   **Provisioning**: The ALB instance is being created.
*   **Configuring**: The ALB instance is being modified.
*   **CreateFailed**: The system failed to create the ALB instance. In this case, you are not charged for the ALB instance. You can only delete the ALB instance.', example='Active'),
  modificationProtectionConfig?: {
    reason?: string(name='Reason', description='The reason for enabling the configuration read-only mode. The reason must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The reason must start with a letter.

This parameter is valid only if **ModificationProtectionStatus** is set to **ConsoleProtection**.', example='test'),
    status?: string(name='Status', description='The status of the configuration read-only mode. Valid values:

*   **NonProtection**: The configuration read-only mode is disabled. In this case, you cannot specify ModificationProtectionReason. If you specify ModificationProtectionReason, the value of the parameter is cleared.
*   **ConsoleProtection**: The configuration read-only mode is enabled. In this case, you can specify ModificationProtectionReason.

> If you set this parameter to **ConsoleProtection**, you cannot use the ALB console to modify instance configurations. However, you can call API operations to modify instance configurations.', example='ConsoleProtection'),
  }(name='ModificationProtectionConfig', description='The configuration of the configuration read-only mode.'),
  regionId?: string(name='RegionId', description='The region ID of the ALB instance.', example='cn-hangzhou'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-atstuj3rtop****'),
  securityGroupIds?: [ string ](name='SecurityGroupIds', description='The IDs of the security groups to which the ALB instance is added.'),
  tags?: [ 
    {
      key?: string(name='Key', description='The tag key.

The tag key can be up to 128 characters in length, and cannot contain `http://` or `https://`. It cannot start with `acs:` or `aliyun`.', example='FinanceDept'),
      value?: string(name='Value', description='The tag value.

The tag value can be up to 128 characters in length, and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.', example='FinanceJoshua'),
    }
  ](name='Tags', description='The tag value.

The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. The tag value cannot contain `http://` or `https://`.'),
  vpcId?: string(name='VpcId', description='The ID of the VPC in which the ALB instance is deployed.', example='vpc-bp1b49rqrybk45nio****'),
  zoneMappings?: [ 
    {
      loadBalancerAddresses?: [ 
        {
          address?: string(name='Address', description='An IPv4 address.

This parameter takes effect when **AddressIPVersion** is set to **IPv4** or **DualStack**. The network type is determined by the value of **AddressType**.', example='192.168.10.1'),
          allocationId?: string(name='AllocationId', description='The elastic IP address (EIP).', example='eip-uf6wm****1zj9'),
          eipType?: string(name='EipType', description='The type of EIP. Valid values:

*   **Common**: an EIP.
*   **Anycast**: an Anycast EIP.

>  For more information about the regions in which ALB supports Anycast EIPs, see [Limits](https://help.aliyun.com/document_detail/460727.html).', example='Common'),
          intranetAddress?: string(name='IntranetAddress', description='The private IPv4 address.', example='10.0.1.181'),
          intranetAddressHcStatus?: string(name='IntranetAddressHcStatus', description='The health status of the private IPv4 address of the ALB instance. 
This parameter is returned only when the Status of the zone is Active.Valid values:

- **Healthy**

- **Unhealthy**', example='Healthy'),
          ipv4LocalAddresses?: [ string ](name='Ipv4LocalAddresses', description='The IPv4 link-local addresses. The IP addresses that the ALB instance uses to communicate with the backend servers.'),
          ipv6Address?: string(name='Ipv6Address', description='An IPv6 address.

This parameter takes effect only when **AddressIPVersion** is set to **DualStack**. The network type is determined by the value of **Ipv6AddressType**.', example='2408:XXXX:39d:eb00::/56'),
          ipv6AddressHcStatus?: string(name='Ipv6AddressHcStatus', description='The health status of the private IPv6 address of the ALB instance. 
This parameter is returned only when the Status of the zone is Active.Valid values:

- **Healthy**

- **Unhealthy**', example='Healthy'),
          ipv6LocalAddresses?: [ string ](name='Ipv6LocalAddresses', description='The IPv6 link-local addresses. The IP addresses that the ALB instance uses to communicate with the backend servers.'),
        }
      ](name='LoadBalancerAddresses', description='The address of the ALB instance.'),
      status?: string(name='Status', description='The zone status. Valid values:

- **Active**: The ALB instance is running.

- **Stopped**: The ALB instance is disabled. 

- **Shifted**: The ALB instance is removed.

- **Starting**: The ALB instance is starting.

- **Stopping**: The ALB instance is stopping.', example='Active'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch in the zone. You can specify only one vSwitch (subnet) in each zone of an ALB instance.', example='vsw-bp12mw1f8k3jgy****'),
      zoneId?: string(name='ZoneId', description='The zone ID of the ALB instance.

You can call the [DescribeZones](https://help.aliyun.com/document_detail/189196.html) operation to query the most recent zone list.', example='cn-hangzhou-a'),
    }
  ](name='ZoneMappings', description='The mappings between zones and vSwitches. At most 10 zones are returned. If the current region supports two or more zones, at least two zones are returned.'),
}

model GetLoadBalancerAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetLoadBalancerAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details of an Application Load Balancer (ALB) instance.
 *
 * @param request GetLoadBalancerAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetLoadBalancerAttributeResponse
 */
async function getLoadBalancerAttributeWithOptions(request: GetLoadBalancerAttributeRequest, runtime: $RuntimeOptions): GetLoadBalancerAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetLoadBalancerAttribute',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details of an Application Load Balancer (ALB) instance.
 *
 * @param request GetLoadBalancerAttributeRequest
 * @return GetLoadBalancerAttributeResponse
 */
async function getLoadBalancerAttribute(request: GetLoadBalancerAttributeRequest): GetLoadBalancerAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return getLoadBalancerAttributeWithOptions(request, runtime);
}

model ListAScriptsRequest {
  AScriptIds?: [ string ](name='AScriptIds', description='The AScript rule IDs. You can specify at most 20 IDs in each call.'),
  AScriptNames?: [ string ](name='AScriptNames', description='The AScript rule names. You can specify at most 10 names in each call.'),
  listenerIds?: [ string ](name='ListenerIds', description='The listener IDs. You can specify at most 20 listener IDs in each call.'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return.

Valid values: **1** to **100**.

Default value: **20**. If you do not specify this parameter, the default value is used.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.****
*   You must specify the token that is obtained from the previous query as the value of **NextToken**.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
}

model ListAScriptsResponseBody = {
  AScripts?: [ 
    {
      AScriptId?: string(name='AScriptId', description='The AScript rule ID.', example='as-aznwocxofkakf7****'),
      AScriptName?: string(name='AScriptName', description='The name of the AScript rule.', example='test'),
      AScriptStatus?: string(name='AScriptStatus', description='The status of the AScript rule. Valid values:

*   **Creating**
*   **Available**
*   **Configuring**
*   **Deleting**', example='Available'),
      enabled?: boolean(name='Enabled', description='Indicates whether the AScript rule is enabled. Valid values:

*   **true**
*   **false**', example='true'),
      listenerId?: string(name='ListenerId', description='The listener ID.', example='lsn-t0w1m9r6suiwmc****'),
      loadBalancerId?: string(name='LoadBalancerId', description='The Application Load Balancer (ALB) instance ID.', example='alb-vv9rg2ub31tyec****'),
      scriptContent?: string(name='ScriptContent', description='The content of the AScript rule.', example='{test}'),
    }
  ](name='AScripts', description='The AScript rules.'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries returned.', example='50'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.

This parameter is required.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='2CA81429-F160-593A-8AB5-A2A9617845B9'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.

> This parameter is optional. By default, this parameter is not returned.', example='1000'),
}

model ListAScriptsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAScriptsResponseBody(name='body'),
}

/**
 * @summary Queries AScript rules.
 *
 * @param request ListAScriptsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAScriptsResponse
 */
async function listAScriptsWithOptions(request: ListAScriptsRequest, runtime: $RuntimeOptions): ListAScriptsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.AScriptIds)) {
    query['AScriptIds'] = request.AScriptIds;
  }
  if (!$isNull(request.AScriptNames)) {
    query['AScriptNames'] = request.AScriptNames;
  }
  if (!$isNull(request.listenerIds)) {
    query['ListenerIds'] = request.listenerIds;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAScripts',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries AScript rules.
 *
 * @param request ListAScriptsRequest
 * @return ListAScriptsResponse
 */
async function listAScripts(request: ListAScriptsRequest): ListAScriptsResponse {
  var runtime = new $RuntimeOptions{};
  return listAScriptsWithOptions(request, runtime);
}

model ListAclEntriesRequest {
  aclId?: string(name='AclId', description='The ID of the ACL.

This parameter is required.', example='nacl-hp34s2h0xx1ht4nwo****'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: **1** to **100**. Default value: **20**.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of **NextToken**.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
}

model ListAclEntriesResponseBody = {
  aclEntries?: [ 
    {
      description?: string(name='Description', description='The description of the ACL entry. The description must be 1 to 256 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_).', example='test-entry'),
      entry?: string(name='Entry', description='The CIDR block for the ACL entry.', example='10.0.1.1/24'),
      status?: string(name='Status', description='The status of the ACL entry. Valid values:

*   **Adding**: The ACL entry is being added.
*   **Available**: The ACL entry is added and available.
*   **Removing**: The ACL entry is being removed.', example='Available'),
    }
  ](name='AclEntries', description='The ACL entries.'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='50'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1000'),
}

model ListAclEntriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAclEntriesResponseBody(name='body'),
}

/**
 * @summary Queries the entries of an access control list (ACL).
 *
 * @param request ListAclEntriesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAclEntriesResponse
 */
async function listAclEntriesWithOptions(request: ListAclEntriesRequest, runtime: $RuntimeOptions): ListAclEntriesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAclEntries',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the entries of an access control list (ACL).
 *
 * @param request ListAclEntriesRequest
 * @return ListAclEntriesResponse
 */
async function listAclEntries(request: ListAclEntriesRequest): ListAclEntriesResponse {
  var runtime = new $RuntimeOptions{};
  return listAclEntriesWithOptions(request, runtime);
}

model ListAclRelationsRequest {
  aclIds?: [ string ](name='AclIds', description='The access control list (ACL) IDs. You can query at most five ACLs in each call.

This parameter is required.'),
}

model ListAclRelationsResponseBody = {
  aclRelations?: [ 
    {
      aclId?: string(name='AclId', description='ACL ID', example='nacl-hp34s2h0xx1ht4nwo****'),
      relatedListeners?: [ 
        {
          listenerId?: string(name='ListenerId', description='The listener ID.', example='lsr-bp1bpn0kn908w4nbw****'),
          listenerPort?: int32(name='ListenerPort', description='The listener port.', example='80'),
          listenerProtocol?: string(name='ListenerProtocol', description='The listener protocol.', example='HTTPS'),
          loadBalancerId?: string(name='LoadBalancerId', description='The ID of the SLB instance.', example='lb-bp1b6c719dfa08ex****'),
          status?: string(name='Status', description='The association status between the ACL and the listener.

*   **Associating**
*   **Associated**
*   **Dissociating**', example='Associated'),
        }
      ](name='RelatedListeners', description='The listeners that are associated with the ACL.'),
    }
  ](name='AclRelations', description='The relations between the specified ACL and the listeners.'),
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
}

model ListAclRelationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAclRelationsResponseBody(name='body'),
}

/**
 * @summary Queries the listeners that are associated with access control lists (ACLs).
 *
 * @param request ListAclRelationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAclRelationsResponse
 */
async function listAclRelationsWithOptions(request: ListAclRelationsRequest, runtime: $RuntimeOptions): ListAclRelationsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aclIds)) {
    query['AclIds'] = request.aclIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAclRelations',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the listeners that are associated with access control lists (ACLs).
 *
 * @param request ListAclRelationsRequest
 * @return ListAclRelationsResponse
 */
async function listAclRelations(request: ListAclRelationsRequest): ListAclRelationsResponse {
  var runtime = new $RuntimeOptions{};
  return listAclRelationsWithOptions(request, runtime);
}

model ListAclsRequest {
  aclIds?: [ string ](name='AclIds', description='Filter access control lists (ACLs) by ACL ID. You can specify at most 20 ACL IDs in each call.'),
  aclNames?: [ string ](name='AclNames', description='The ACL names. You can specify up to 10 ACL names in each call.'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return. This parameter is optional. Valid values: **1** to **100**. Default value: **20**.', example='50'),
  nextToken?: string(name='NextToken', description='The token that is used for the next query. Valid values:

*   If this is your first query or no next query is to be sent, ignore this parameter.
*   If a next query is to be sent, set the value to the value of NextToken that is returned from the last call.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group. You can filter the query results based on the specified ID.', example='rg-atstuj3rtopty****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tag', description='The tags.'),
}

model ListAclsResponseBody = {
  acls?: [ 
    {
      aclId?: string(name='AclId', description='The ACL ID.', example='nacl-hp34s2h0xx1ht4nwo****'),
      aclName?: string(name='AclName', description='The name of the ACL.', example='test-acl'),
      aclStatus?: string(name='AclStatus', description='The status of the ACL. Valid values:

*   **Creating**: The network ACL is being created.
*   **Available**: The network ACL is available.
*   **Configuring**', example='Available'),
      addressIPVersion?: string(name='AddressIPVersion', description='The IP version of the ACL. Only **IPv4** may be returned.', example='IPv4'),
      configManagedEnabled?: boolean(name='ConfigManagedEnabled', description='Indicates whether configuration management is enabled. Valid values:

*   **true**
*   **false**', example='false'),
      createTime?: string(name='CreateTime', description='The time when the ACL was created. The follows the `YYYY-MM-DDThh:mm:ssZ` format.', example='2023-02-15T07:37:33Z'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-atstuj3rtopty****'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.', example='env'),
          value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.', example='product'),
        }
      ](name='Tags', description='The tags.'),
    }
  ](name='Acls', description='A list of ACLs.'),
  maxResults?: int32(name='MaxResults', description='The maximum number of network ACLs returned. This parameter is optional. Valid values: **1** to **100**. If this parameter is not set, the default value **20** is returned.', example='20'),
  nextToken?: string(name='NextToken', description='The token that is used for the next query. Valid values:

*   If **NextToken** is empty, it indicates that no next query is to be sent.
*   If **NextToken** is returned, the value indicates the token that is used for the next query.', example='FFmyTO70t****'),
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model ListAclsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAclsResponseBody(name='body'),
}

/**
 * @summary Queries the access control lists (ACLs) in a region.
 *
 * @param request ListAclsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAclsResponse
 */
async function listAclsWithOptions(request: ListAclsRequest, runtime: $RuntimeOptions): ListAclsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aclIds)) {
    query['AclIds'] = request.aclIds;
  }
  if (!$isNull(request.aclNames)) {
    query['AclNames'] = request.aclNames;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAcls',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the access control lists (ACLs) in a region.
 *
 * @param request ListAclsRequest
 * @return ListAclsResponse
 */
async function listAcls(request: ListAclsRequest): ListAclsResponse {
  var runtime = new $RuntimeOptions{};
  return listAclsWithOptions(request, runtime);
}

model ListAsynJobsRequest {
  apiName?: string(name='ApiName', description='The name of the operation.', example='CreateLoadBalancer'),
  beginTime?: long(name='BeginTime', description='The timestamp that indicates the start time of the task. Unit: milliseconds.

Specify the timestamp in the Unix format to indicate the total amount of time that is from 00:00:00 (UTC+0) on January 1, 1970 to when the status of the asynchronous task is queried.', example='2021-06-03T17:22Z'),
  endTime?: long(name='EndTime', description='The timestamp that indicates the end time of the task. Unit: milliseconds.

Specify the timestamp in the Unix format to indicate the total amount of time that is from 00:00:00 (UTC+0) on January 1, 1970 to when the status of the asynchronous task is returned.', example='2021-06-04T17:22Z'),
  jobIds?: [ string ](name='JobIds', description='The asynchronous task IDs.'),
  maxResults?: long(name='MaxResults', description='The number of entries per page. Valid values: **1** to **100**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of **NextToken**.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  resourceIds?: [ string ](name='ResourceIds', description='The resource IDs.'),
  resourceType?: string(name='ResourceType', description='The type of the associated resource. Valid values:

*   **loadbalancer**: an Application Load Balancer (ALB) instance
*   **listener**: a listener
*   **rule**: a forwarding rule
*   **acl**: an access control list (ACL)
*   **securitypolicy**: a security policy
*   **servergroup**: a server group', example='acl'),
}

model ListAsynJobsResponseBody = {
  jobs?: [ 
    {
      apiName?: string(name='ApiName', description='The name of the operation.', example='CreateLoadBalancer'),
      createTime?: long(name='CreateTime', description='The timestamp that indicates the start time of the task. Unit: milliseconds.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='2134663231234'),
      errorCode?: string(name='ErrorCode', description='If the value of **Status** is Failed, an error code is returned.', example='506'),
      errorMessage?: string(name='ErrorMessage', description='If the value of **Status** is Failed, an error message is returned.', example='AllocateEipAddress Failed'),
      id?: string(name='Id', description='The task ID.', example='365F4154-92F6-4AE4-92F8-7FF34B5****'),
      modifyTime?: long(name='ModifyTime', description='The timestamp that indicates the end time of the task. Unit: milliseconds.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='2144663233315'),
      operateType?: string(name='OperateType', description='The type of the operation. Valid values:

*   **Create**
*   **Update**
*   **Delete**', example='Create'),
      resourceId?: string(name='ResourceId', description='The associated resource ID.', example='alb-o8mszt95oamfjy****'),
      resourceType?: string(name='ResourceType', description='The type of the associated resource. Valid values:

*   **loadbalancer**: an ALB instance
*   **listener**: a listener
*   **rule**: a forwarding rule
*   **acl**: an ACL
*   **securitypolicy**: a security policy
*   **servergroup**: a server group', example='acl'),
      status?: string(name='Status', description='The status of the task. Valid values:

*   **Succeeded**
*   **Failed**
*   **Processing**', example='Succeeded'),
    }
  ](name='Jobs', description='The tasks.'),
  maxResults?: long(name='MaxResults', description='The number of entries per page.', example='10'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1000'),
}

model ListAsynJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAsynJobsResponseBody(name='body'),
}

/**
 * @summary Queries asynchronous tasks in a region.
 *
 * @param request ListAsynJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAsynJobsResponse
 */
async function listAsynJobsWithOptions(request: ListAsynJobsRequest, runtime: $RuntimeOptions): ListAsynJobsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!$isNull(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.jobIds)) {
    query['JobIds'] = request.jobIds;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.resourceIds)) {
    query['ResourceIds'] = request.resourceIds;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAsynJobs',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries asynchronous tasks in a region.
 *
 * @param request ListAsynJobsRequest
 * @return ListAsynJobsResponse
 */
async function listAsynJobs(request: ListAsynJobsRequest): ListAsynJobsResponse {
  var runtime = new $RuntimeOptions{};
  return listAsynJobsWithOptions(request, runtime);
}

model ListHealthCheckTemplatesRequest {
  healthCheckTemplateIds?: [ string ](name='HealthCheckTemplateIds', description='The IDs of health check templates.'),
  healthCheckTemplateNames?: [ string ](name='HealthCheckTemplateNames', description='The health check templates.'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: **1** to **100**. Default value: **20**.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of **NextToken**.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  resourceGroupId?: string(name='ResourceGroupId'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tag', description='The tags.'),
}

model ListHealthCheckTemplatesResponseBody = {
  healthCheckTemplates?: [ 
    {
      healthCheckCodes?: [ string ](name='HealthCheckCodes', description='The HTTP status codes that indicate healthy backend servers.'),
      healthCheckConnectPort?: int32(name='HealthCheckConnectPort', description='The port that is used for health checks.

Valid values: \\\\*\\\\* 0 to 65535\\\\*\\\\*.

The default value is **0**, which specifies that the port of a backend server is used for health checks.', example='80'),
      healthCheckHost?: string(name='HealthCheckHost', description='The domain name that is used for health checks. Valid values:

*   **$SERVER_IP** (default): the private IP address of a backend server. If an IP address is specified, or this parameter is not specified, the ALB instance uses the private IP address of each backend server as the domain name for health checks.
*   **domain**: The domain name must be 1 to 80 characters in length, and can contain letters, digits, periods (.), and hyphens (-).

>  This parameter takes effect only if you set `HealthCheckProtocol` to **HTTP** or **HTTPS**.', example='$_ip'),
      healthCheckHttpVersion?: string(name='HealthCheckHttpVersion', description='The HTTP version for health checks.

Valid values: **HTTP 1.0** and **HTTP 1.1**.

Default value: **HTTP 1.1**.

>  This parameter takes effect only if you set `HealthCheckProtocol` to **HTTP** or **HTTPS**.', example='HTTP 1.0'),
      healthCheckInterval?: int32(name='HealthCheckInterval', description='The interval at which health checks are performed. Unit: seconds. Valid values: **1 to 50**. Default value: **2**.', example='5'),
      healthCheckMethod?: string(name='HealthCheckMethod', description='The HTTP method that is used for health checks. Valid values:

*   **HEAD** (default): By default, HTTP and HTTPS health checks use the HEAD method.
*   **GET**: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.
*   **POST**: gRPC health checks use the POST method by default.

>  This parameter takes effect only if you set **HealthCheckProtocol** to **HTTP**, **HTTPS**, or **gRPC**.', example='HEAD'),
      healthCheckPath?: string(name='HealthCheckPath', description='The URL path that you want to use for health checks.

The URL must be 1 to 80 characters in length, and can contain letters, digits, the following special characters: - / . % ? # &, and the following extended characters: `_ ; ~ ! ( ) * [ ] @ $ ^ : \\\\" , +`. The URL must start with a forward slash (/).', example='/test/index.html'),
      healthCheckProtocol?: string(name='HealthCheckProtocol', description='The protocol that is used for health checks. Valid values:

*   **HTTP** (default): The ALB instance sends HEAD or GET requests, which simulate browser requests, to check whether the backend server is healthy.
*   **HTTPS**: HTTPS health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers. HTTPS provides higher security because HTTPS supports data encryption.
*   **TCP**: TCP health checks send TCP SYN packets to a backend server to check whether the port of the backend server is reachable.
*   **gRPC**: gRPC health checks send POST or GET requests to a backend server to check whether the backend server is healthy.', example='HTTP'),
      healthCheckTemplateId?: string(name='HealthCheckTemplateId', description='The ID of the health check template.', example='hct-bp1qjwo61pqz3ahltv****'),
      healthCheckTemplateName?: string(name='HealthCheckTemplateName', description='The name of the health check template.

The name must be 2 to 128 character characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.', example='HealthCheckTemplate1'),
      healthCheckTimeout?: int32(name='HealthCheckTimeout', description='The timeout period of a health check response. If a backend Elastic Compute Service (ECS) instance does not respond within the specified timeout period, the ECS instance fails to pass the health check.

Valid values: **1 to 300**. Unit: seconds.

Default value: **5**.', example='3'),
      healthyThreshold?: int32(name='HealthyThreshold', description='The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status changes from **fail** to **success**.

Valid values: **2 to 10**.

Default value: **3**.', example='4'),
      resourceGroupId?: string(name='ResourceGroupId'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length, and cannot contain `http://` or `https://`. The tag key cannot start with `acs:` or `aliyun`.', example='env'),
          value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length, and cannot contain `http://` or `https://`. The tag value cannot start with `acs:` or `aliyun`.', example='product'),
        }
      ](name='Tags', description='The tags.'),
      unhealthyThreshold?: int32(name='UnhealthyThreshold', description='The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status changes from **success** to **fail**.

Valid values: **2 to 10**.

Default value: **3**.', example='4'),
    }
  ](name='HealthCheckTemplates', description='The health check templates.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page. Valid values: **1** to **100**. Default value: **20**.', example='50'),
  nextToken?: string(name='NextToken', description='The returned value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value of **NextToken** was returned in the previous query, specify the value to obtain the next set of results.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1000'),
}

model ListHealthCheckTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHealthCheckTemplatesResponseBody(name='body'),
}

/**
 * @summary Queries health check templates in a region.
 *
 * @param request ListHealthCheckTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHealthCheckTemplatesResponse
 */
async function listHealthCheckTemplatesWithOptions(request: ListHealthCheckTemplatesRequest, runtime: $RuntimeOptions): ListHealthCheckTemplatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.healthCheckTemplateIds)) {
    query['HealthCheckTemplateIds'] = request.healthCheckTemplateIds;
  }
  if (!$isNull(request.healthCheckTemplateNames)) {
    query['HealthCheckTemplateNames'] = request.healthCheckTemplateNames;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListHealthCheckTemplates',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries health check templates in a region.
 *
 * @param request ListHealthCheckTemplatesRequest
 * @return ListHealthCheckTemplatesResponse
 */
async function listHealthCheckTemplates(request: ListHealthCheckTemplatesRequest): ListHealthCheckTemplatesResponse {
  var runtime = new $RuntimeOptions{};
  return listHealthCheckTemplatesWithOptions(request, runtime);
}

model ListListenerCertificatesRequest {
  certificateIds?: [ string ](name='CertificateIds', description='The certificate IDs.'),
  certificateType?: string(name='CertificateType', description='The type of the certificate. Valid values: **Ca** and **Server**.', example='Server'),
  listenerId?: string(name='ListenerId', description='The listener ID. You must specify the ID of an HTTPS listener or a QUIC listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return. Valid values: **1 to 100**. Default value: **20**.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of **NextToken**.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
}

model ListListenerCertificatesResponseBody = {
  certificates?: [ 
    {
      certificateId?: string(name='CertificateId', description='The certificate ID. Only server certificates are supported.', example='12315790343_166f8204689_1714763408_70998****'),
      certificateType?: string(name='CertificateType', description='The type of the certificate.', example='Server'),
      isDefault?: boolean(name='IsDefault', description='Indicates whether the certificate is the default certificate of the listener. Valid values:

*   **true**
*   **false**', example='true'),
      status?: string(name='Status', description='Indicates whether the certificate is associated with the listener. Valid values:

*   **Associating**
*   **Associated**
*   **Diassociating**', example='Associating'),
    }
  ](name='Certificates', description='The certificates.'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries returned.', example='50'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1000'),
}

model ListListenerCertificatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListListenerCertificatesResponseBody(name='body'),
}

/**
 * @summary Queries the certificates that are associated with a listener, including additional certificates and the default certificate.
 *
 * @param request ListListenerCertificatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListListenerCertificatesResponse
 */
async function listListenerCertificatesWithOptions(request: ListListenerCertificatesRequest, runtime: $RuntimeOptions): ListListenerCertificatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certificateIds)) {
    query['CertificateIds'] = request.certificateIds;
  }
  if (!$isNull(request.certificateType)) {
    query['CertificateType'] = request.certificateType;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListListenerCertificates',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the certificates that are associated with a listener, including additional certificates and the default certificate.
 *
 * @param request ListListenerCertificatesRequest
 * @return ListListenerCertificatesResponse
 */
async function listListenerCertificates(request: ListListenerCertificatesRequest): ListListenerCertificatesResponse {
  var runtime = new $RuntimeOptions{};
  return listListenerCertificatesWithOptions(request, runtime);
}

model ListListenersRequest {
  listenerIds?: [ string ](name='ListenerIds', description='The listener IDs. You can specify at most 20 listener IDs.'),
  listenerProtocol?: string(name='ListenerProtocol', description='The listener protocol. Valid values:

*   **HTTP**
*   **HTTPS**
*   **QUIC**', example='HTTP'),
  loadBalancerIds?: [ string ](name='LoadBalancerIds', description='The ALB instance ID. You can specify at most 20 instance IDs.'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return. This parameter is optional. Valid values: **1 to 100**. If you do not specify this parameter, the default value **20** is used.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   If a value is returned for NextToken, you must specify the token that is obtained from the previous query as the value of **NextToken**.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tag', description='The tags.'),
}

model ListListenersResponseBody = {
  listeners?: [ 
    {
      defaultActions?: [ 
        {
          forwardGroupConfig?: {
            serverGroupTuples?: [ 
              {
                serverGroupId?: string(name='ServerGroupId', description='The ID of the server group to which requests are forwarded.', example='rsp-cige6j****'),
              }
            ](name='ServerGroupTuples', description='The server groups to which requests are forwarded.'),
          }(name='ForwardGroupConfig', description='The configuration of the forwarding rule action. This parameter takes effect only when the action is **ForwardGroup**.'),
          type?: string(name='Type', description='The action. **ForwardGroup**: forwards requests to multiple server groups.', example='ForwardGroup'),
        }
      ](name='DefaultActions', description='The default actions in the forwarding rules.'),
      gzipEnabled?: boolean(name='GzipEnabled', description='Indicates whether GZIP compression is enabled to compress specific types of files. Valid values:

*   **true**
*   **false**', example='false'),
      http2Enabled?: boolean(name='Http2Enabled', description='Indicates whether HTTP/2 is enabled. Valid values:

*   **true**
*   **false**

>  Only HTTPS listeners support this parameter.', example='false'),
      idleTimeout?: int32(name='IdleTimeout', description='The timeout period of an idle connection. Unit: seconds. Valid values: **1 to 60**.

If no request is received within the specified timeout period, ALB closes the connection. ALB establishes the connection again when a new connection request is received.', example='3'),
      listenerDescription?: string(name='ListenerDescription', description='The name of the listener.', example='test'),
      listenerId?: string(name='ListenerId', description='The listener ID.', example='lsr-bp1bpn0kn908w4nbw****'),
      listenerPort?: int32(name='ListenerPort', description='The frontend port that is used by the ALB instance. Valid values: **1 to 65535**.', example='80'),
      listenerProtocol?: string(name='ListenerProtocol', description='The listener protocol of the instance. Valid values:

*   **HTTP**
*   **HTTPS**
*   **QUIC**', example='HTTP'),
      listenerStatus?: string(name='ListenerStatus', description='The status of the listener. Valid values:

*   **Provisioning**: The listener is being created.
*   **Running**: The listener is running.
*   **Configuring**: The listener is being configured.
*   **Stopped**: The listener is disabled.', example='Running'),
      loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.', example='lb-bp1b6c719dfa08ex*****'),
      logConfig?: {
        accessLogRecordCustomizedHeadersEnabled?: boolean(name='AccessLogRecordCustomizedHeadersEnabled', description='Indicates whether custom headers are carried in the access log. Valid values:

*   **true**
*   **false**', example='true'),
        accessLogTracingConfig?: {
          tracingEnabled?: boolean(name='TracingEnabled', description='Indicates whether xtrace is enabled. Valid values:

*   **true**
*   **false**

>  This parameter can be set to **true** only when the access log feature of ALB is enabled by setting **AccessLogEnabled** to true.', example='true'),
          tracingSample?: int32(name='TracingSample', description='The sampling rate of xtrace. Valid values: **1 to 10000**.

>  This parameter takes effect when **TracingEnabled** is set to **true**.', example='100'),
          tracingType?: string(name='TracingType', description='The type of xtrace. The value is set to **Zipkin**.

>  This parameter takes effect when **TracingEnabled** is set to **true**.', example='Zipkin'),
        }(name='AccessLogTracingConfig', description='The configurations of xtrace.'),
      }(name='LogConfig', description='The logging configurations.'),
      quicConfig?: {
        quicListenerId?: string(name='QuicListenerId', description='The ID of the QUIC listener associated with the ALB instance. This parameter is required if the **QuicUpgradeEnabled** parameter is set to **true**. Only HTTPS listeners support this parameter.

>  The existing listener and QUIC listener must be to the same ALB instance, and the QUIC listener has not been associated with an ALB instance.', example='lsr-bp1bpn908w4nbw****'),
        quicUpgradeEnabled?: boolean(name='QuicUpgradeEnabled', description='Indicates whether QUIC upgrade is enabled. Valid values:

*   **true**
*   **false**

>  Only HTTPS listeners support this parameter.', example='true'),
      }(name='QuicConfig', description='The configurations of the QUIC listener associated with the ALB instance.'),
      requestTimeout?: int32(name='RequestTimeout', description='The timeout period of a request. Unit: seconds. Valid values: **1 to 180**.

If no responses are received from the backend server within the specified timeout period, ALB returns an `HTTP 504` error code to the client.', example='34'),
      securityPolicyId?: string(name='SecurityPolicyId', description='The security policy.

>  Only HTTPS listeners support this parameter.', example='tls_cipher_policy_1_1'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.', example='env'),
          value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.', example='product'),
        }
      ](name='Tags', description='The tags.'),
      XForwardedForConfig?: {
        XForwardedForClientCertClientVerifyAlias?: string(name='XForwardedForClientCertClientVerifyAlias', description='The name of the custom header. This parameter takes effect only when **XForwardedForClientCertClientVerifyEnabled** is set to **true**.

The name must be 1 to 40 characters in length, and can contain lowercase letters, digits, hyphens (-), and underscores (_).

>  Only HTTPS listeners support this parameter.', example='test_client-verify-alias_123456'),
        XForwardedForClientCertClientVerifyEnabled?: boolean(name='XForwardedForClientCertClientVerifyEnabled', description='Indicates whether the `X-Forwarded-Clientcert-clientverify` header is used to obtain the verification result of the client certificate. Valid values:

*   **true**
*   **false**

>  Only HTTPS listeners support this parameter.', example='true'),
        XForwardedForClientCertFingerprintAlias?: string(name='XForwardedForClientCertFingerprintAlias', description='The name of the custom header. This parameter takes effect only when **XForwardedForClientCertFingerprintEnabled** is set to **true**.

The name must be 1 to 40 characters in length, and can contain lowercase letters, digits, hyphens (-), and underscores (_).

>  Only HTTPS listeners support this parameter.', example='test_finger-print-alias_123456'),
        XForwardedForClientCertFingerprintEnabled?: boolean(name='XForwardedForClientCertFingerprintEnabled', description='Indicates whether the `X-Forwarded-Clientcert-fingerprint` header is used to retrieve the fingerprint of the client certificate. Valid values:

*   **true**
*   **false**

>  Only HTTPS listeners support this parameter.', example='true'),
        XForwardedForClientCertIssuerDNAlias?: string(name='XForwardedForClientCertIssuerDNAlias', description='The name of the custom header. This parameter takes effect only when **XForwardedForClientCertIssuerDNEnabled** is set to **true**.

The name must be 1 to 40 characters in length, and can contain lowercase letters, digits, hyphens (-), and underscores (_).

>  Only HTTPS listeners support this parameter.', example='test_issue-dn-alias_123456'),
        XForwardedForClientCertIssuerDNEnabled?: boolean(name='XForwardedForClientCertIssuerDNEnabled', description='Indicates whether the `X-Forwarded-Clientcert-issuerdn` header is used to retrieve information about the authority that issues the client certificate. Valid values:

*   **true**
*   **false**

>  Only HTTPS listeners support this parameter.', example='true'),
        XForwardedForClientCertSubjectDNAlias?: string(name='XForwardedForClientCertSubjectDNAlias', description='The name of the custom header. This parameter takes effect only when **XForwardedForClientCertSubjectDNEnabled** is set to **true**.

The name must be 1 to 40 characters in length, and can contain lowercase letters, digits, hyphens (-), and underscores (_).

>  Only HTTPS listeners support this parameter.', example='test_subject-dn-alias_123456'),
        XForwardedForClientCertSubjectDNEnabled?: boolean(name='XForwardedForClientCertSubjectDNEnabled', description='Indicates whether the `X-Forwarded-Clientcert-subjectdn` header is used to retrieve information about the owner of the client certificate. Valid values:

*   **true**
*   **false**

>  Only HTTPS listeners support this parameter.', example='true'),
        XForwardedForClientSourceIpsEnabled?: boolean(name='XForwardedForClientSourceIpsEnabled', description='Indicates whether the X-Forwarded-For header is used to preserver client IP addresses for the ALB instance. Valid values:

*   **true**
*   **false**

>  This parameter is returned only for HTTP and HTTPS listeners.', example='false'),
        XForwardedForClientSourceIpsTrusted?: string(name='XForwardedForClientSourceIpsTrusted', description='The trusted proxy IP address.

ALB instances traverse the IP addresses in the `X-Forwarded-For` header from the rightmost IP address to the leftmost IP address. The first IP address that is not on the trusted IP address list is considered the client IP address. Requests from the client IP address are throttled.', example='10.1.1.0/24'),
        XForwardedForClientSrcPortEnabled?: boolean(name='XForwardedForClientSrcPortEnabled', description='Indicates whether the `X-Forwarded-Client-Port` header is used to retrieve the client port. Valid values:

*   **true**
*   **false**

>  This parameter is returned only for HTTP and HTTPS listeners.', example='true'),
        XForwardedForEnabled?: boolean(name='XForwardedForEnabled', description='Specifies whether to use the `X-Forwarded-For` header to retrieve client IP addresses. Valid values:

*   **true** (default)
*   **false**

> *   If this parameter is set to **true**, the default value of the **XForwardedForProcessingMode** parameter is **append**. You can change it to **remove**.
> *   If this parameter is set to **false**, the `X-Forwarded-For` header in the request is not modified in any way before the request is sent to backend servers.
> *   Both HTTP and HTTPS listeners support this parameter.', example='true'),
        XForwardedForHostEnabled?: boolean(name='XForwardedForHostEnabled', description='Specifies whether to use the `X-Forwarded-Host` header to retrieve client domain names. Valid values:

*   **true**
*   **false** (default)

>  HTTP, HTTPS, and QUIC listeners all support this parameter.', example='false'),
        XForwardedForProcessingMode?: string(name='XForwardedForProcessingMode', description='Specifies how the `X-Forwarded-For` header is processed. This parameter takes effect only when **XForwardedForEnabled** is set to **true**. Valid values:

*   **append** (default)
*   **remove**

> *   If this parameter is set to **append**, ALB appends the IP address of the last hop to the existing `X-Forwarded-For` header in the request before the request is sent to backend servers.
> *   If this parameter is set to **remove**, ALB removes the `X-Forwarded-For` header in the request before the request is sent to backend servers, no matter whether the request carries the `X-Forwarded-For` header.
> *   Both HTTP and HTTPS listeners support this parameter.', example='append'),
        XForwardedForProtoEnabled?: boolean(name='XForwardedForProtoEnabled', description='Indicates whether the `X-Forwarded-Proto` header is used to retrieve the listener protocol. Valid values:

*   **true**
*   **false**

>  This parameter is supported by HTTP, HTTPS, and QUIC listeners.', example='true'),
        XForwardedForSLBIdEnabled?: boolean(name='XForwardedForSLBIdEnabled', description='Specifies whether to use the `SLB-ID` header to retrieve the ID of the ALB instance. Valid values:

*   **true**
*   **false**

>  This parameter is supported by HTTP, HTTPS, and QUIC listeners.', example='true'),
        XForwardedForSLBPortEnabled?: boolean(name='XForwardedForSLBPortEnabled', description='Indicates whether the `X-Forwarded-Port` header is used to retrieve the listener port of the ALB instance. Valid values:

*   **true**
*   **false**

>  This parameter is supported by HTTP, HTTPS, and QUIC listeners.', example='true'),
      }(name='XForwardedForConfig', description='The configuration of the `XForward` header.'),
    }
  ](name='Listeners', description='The listeners.'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries returned.', example='50'),
  nextToken?: string(name='NextToken', description='The position where the query stopped. If this parameter is not returned, all data is queried.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1000'),
}

model ListListenersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListListenersResponseBody(name='body'),
}

/**
 * @summary Queries the listeners in a region.
 *
 * @param request ListListenersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListListenersResponse
 */
async function listListenersWithOptions(request: ListListenersRequest, runtime: $RuntimeOptions): ListListenersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.listenerIds)) {
    query['ListenerIds'] = request.listenerIds;
  }
  if (!$isNull(request.listenerProtocol)) {
    query['ListenerProtocol'] = request.listenerProtocol;
  }
  if (!$isNull(request.loadBalancerIds)) {
    query['LoadBalancerIds'] = request.loadBalancerIds;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListListeners',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the listeners in a region.
 *
 * @param request ListListenersRequest
 * @return ListListenersResponse
 */
async function listListeners(request: ListListenersRequest): ListListenersResponse {
  var runtime = new $RuntimeOptions{};
  return listListenersWithOptions(request, runtime);
}

model ListLoadBalancersRequest {
  addressIpVersion?: string(name='AddressIpVersion', description='The IP version. Valid values:

*   **IPv4**
*   **DualStack**', example='IPv4'),
  addressType?: string(name='AddressType', description='The network type. Valid values:

*   **Internet**: The ALB instance uses a public IP address. The domain name of the ALB instance is resolved to the public IP address. Therefore, the ALB instance can be accessed over the Internet.
*   **Intranet**: The ALB instance uses a private IP address. The domain name of the ALB instance is resolved to the private IP address. In this case, the ALB instance can be accessed over the VPC where the ALB instance is deployed.', example='Intranet'),
  DNSName?: string(name='DNSName', description='The domain name.', example='alb-95qnr2itwu9orb****.cn-hangzhou.alb.aliyuncs.com'),
  ipv6AddressType?: string(name='Ipv6AddressType', description='The type of IPv6 address that is used by the ALB instance. Valid values:

*   **Internet**: The ALB instance uses a public IP address. The domain name of the ALB instance is resolved to the public IP address. Therefore, the ALB instance can be accessed over the Internet.
*   **Intranet**: The ALB instance uses a private IP address. The domain name of the ALB instance is resolved to the private IP address. Therefore, the ALB instance can be accessed over the VPC in which the ALB instance is deployed.', example='Intranet'),
  loadBalancerBussinessStatus?: string(name='LoadBalancerBussinessStatus', description='The service status of the ALB instance. Valid values:

*   **Abnormal**
*   **Normal**', example='Normal'),
  loadBalancerIds?: [ string ](name='LoadBalancerIds', description='The instance IDs. You can specify at most 20 ALB instance IDs.'),
  loadBalancerNames?: [ string ](name='LoadBalancerNames', description='The instance names. You can specify at most 10 instance names.'),
  loadBalancerStatus?: string(name='LoadBalancerStatus', description='The status of the ALB instance. Valid values:

*   **Inactive**: The ALB instance is disabled. The listeners do not forward traffic.
*   **Active**: The ALB instance is running.
*   **Provisioning**: The ALB instance is being created.
*   **Configuring**: The ALB instance is being modified.
*   **CreateFailed**: The system failed to create the ALB instance. In this case, you are not charged for the ALB instance. You can only delete the ALB instance. By default, the system deletes the ALB instances that are in the CreateFailed state within the last day.', example='Active'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: **1** to **100**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of **NextToken**.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  payType?: string(name='PayType', description='The billing method of the ALB instance. Set the value to

**PostPay**, which specifies the pay-as-you-go billing method. This is the default value.', example='PostPay'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmxazb4ph****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. You can specify at most 20 tag keys. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.', example='KeyTest'),
      value?: string(name='Value', description='The tag value. You can specify at most 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.', example='alueTest'),
    }
  ](name='Tag', description='The tags added to the ALB instance.'),
  vpcIds?: [ string ](name='VpcIds', description='The ID of the VPC to which the ALB instance belongs. You can specify at most 10 VPC IDs.'),
  zoneId?: string(name='ZoneId', description='The ID of the zone where the ALB instance is deployed.

You can call the [DescribeZones](https://help.aliyun.com/document_detail/189196.html) operation to query zones.', example='cn-hangzhou-a'),
}

model ListLoadBalancersResponseBody = {
  loadBalancers?: [ 
    {
      accessLogConfig?: {
        logProject?: string(name='LogProject', description='The Simple Log Service project.', example='sls-setter'),
        logStore?: string(name='LogStore', description='The Logstore.', example='test'),
      }(name='AccessLogConfig', description='The configurations of access logs.'),
      addressAllocatedMode?: string(name='AddressAllocatedMode', description='The mode in which IP addresses are allocated. Valid values:

*   **Fixed**: The ALB instance uses a static IP address.
*   **Dynamic**: dynamically allocates an IP address to each zone of the ALB instance.', example='Fixed'),
      addressIpVersion?: string(name='AddressIpVersion', description='The IP version. Valid values:

*   **IPv4**
*   **DualStack**', example='DualStack'),
      addressType?: string(name='AddressType', description='The type of IP address that the ALB instance uses to provide services. Valid values:

*   **Internet**: The ALB instance is assigned a public IP address. The domain name is resolved to the public IP address. The ALB instance is accessible over the Internet.
*   **Intranet**: The ALB instance is assigned only a private IP address. The domain name is resolved to the private IP address. The ALB instance is accessible only within the VPC of the ALB instance.', example='Intranet'),
      bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the Internet Shared Bandwidth instance that is associated with the Internet-facing ALB instance.', example='cbwp-bp1vevu8h3ieh****'),
      createTime?: string(name='CreateTime', description='The time when the resource was created.', example='2022-07-02T02:49:05Z'),
      DNSName?: string(name='DNSName', description='The domain name.', example='alb-95qnr2itwu9orb****.cn-hangzhou.alb.aliyuncs.com'),
      deletionProtectionConfig?: {
        enabled?: boolean(name='Enabled', description='Indicates whether deletion protection is enabled. Valid values:

*   **true**
*   **false**', example='true'),
        enabledTime?: string(name='EnabledTime', description='The time when deletion protection is enabled.', example='2022-08-02T02:49:05Z'),
      }(name='DeletionProtectionConfig', description='The configuration of the deletion protection feature.'),
      ipv6AddressType?: string(name='Ipv6AddressType', description='The type of IPv6 address used by the ALB instance. Valid values:

*   **Internet** The ALB instance is assigned a public IP address. The domain name is resolved to the public IP address. The ALB instance is accessible over the Internet.
*   **Intranet** The ALB instance is assigned only a private IP address. The domain name is resolved to the private IP address. The ALB instance is accessible only within the VPC of the ALB instance.', example='Intranet'),
      loadBalancerBillingConfig?: {
        payType?: string(name='PayType', description='The billing method. Valid values:

Only **PostPay** may be returned, which indicates the pay-as-you-go billing method.', example='PostPay'),
      }(name='LoadBalancerBillingConfig', description='The billing information about the ALB instance.'),
      loadBalancerBussinessStatus?: string(name='LoadBalancerBussinessStatus', description='The status of the ALB instance. Valid values:

*   **Abnormal**
*   **Normal**', example='Normal'),
      loadBalancerEdition?: string(name='LoadBalancerEdition', description='The edition of the ALB instance. The features and billing rules vary based on the edition. Valid values:

*   **Basic**
*   **Standard**
*   **StandardWithWaf**', example='Standard'),
      loadBalancerId?: string(name='LoadBalancerId', description='The ID of the ALB instance.', example='alb-o9ulmq5hgn68jk****'),
      loadBalancerName?: string(name='LoadBalancerName', description='The name of the ALB instance.', example='alb-instance-test'),
      loadBalancerOperationLocks?: [ 
        {
          lockReason?: string(name='LockReason', description='The reason why the ALB instance is locked. This parameter is valid only if **LoadBalancerBussinessStatus** is set to **Abnormal**.', example='Test LockReason'),
          lockType?: string(name='LockType', description='The lock type. Valid values:

*   **SecurityLocked**: The ALB instance is locked due to security risks.
*   **RelatedResourceLocked**: The ALB instance is locked due to other resources associated with the ALB instance.
*   **FinancialLocked**: The ALB instance is locked due to overdue payments.
*   **ResidualLocked**: The ALB instance is locked because the associated resources have overdue payments and the resources are released.', example='FinancialLocked'),
        }
      ](name='LoadBalancerOperationLocks', description='The configuration of the operation lock.'),
      loadBalancerStatus?: string(name='LoadBalancerStatus', description='The status of the ALB instance. Valid values:

*   **Inactive**: The ALB instance is disabled. ALB instances in the Inactive state do not forward traffic.
*   **Active**: The ALB instance is running.
*   **Provisioning**: The ALB instance is being created.
*   **Configuring**: The ALB instance is being modified.
*   **CreateFailed**: The system failed to create the ALB instance.', example='Active'),
      modificationProtectionConfig?: {
        reason?: string(name='Reason', description='The reason why the configuration read-only mode is enabled.

The reason must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-).

This parameter is available only if the **ModificationProtectionStatus** parameter is set to **ConsoleProtection**.', example='Test Reason'),
        status?: string(name='Status', description='Indicates whether the configuration read-only mode is enabled for the ALB instance. Valid values:

*   **NonProtection**: Modification protection is disabled. In this case, you cannot set the ModificationProtectionReason parameter. If the ModificationProtectionReason parameter is specified, the value is cleared.
*   **ConsoleProtection**: Modification protection is enabled. In this case, you can set the ModificationProtectionReason parameter.

>  If the value is **ConsoleProtection**, modification protection is enabled. You cannot modify the configurations of the ALB instance in the ALB console. However, you can call API operations to modify the configurations of the ALB instance.', example='ConsoleProtection'),
      }(name='ModificationProtectionConfig', description='The configuration of modification protection.'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-atstuj3rtop****'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key of the ALB instance.', example='KeyTest'),
          value?: string(name='Value', description='The tag value of the ALB instance.', example='alueTest'),
        }
      ](name='Tags', description='The information about the tags.'),
      vpcId?: string(name='VpcId', description='The ID of the VPC in which the ALB instance is deployed.', example='vpc-bp1b49rqrybk45nio****'),
    }
  ](name='LoadBalancers', description='A list of ALB instances.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value is returned for **NextToken**, the value is used to retrieve a new page of results.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='100'),
}

model ListLoadBalancersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLoadBalancersResponseBody(name='body'),
}

/**
 * @summary Queries the configurations of instances.
 *
 * @param request ListLoadBalancersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLoadBalancersResponse
 */
async function listLoadBalancersWithOptions(request: ListLoadBalancersRequest, runtime: $RuntimeOptions): ListLoadBalancersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.addressIpVersion)) {
    query['AddressIpVersion'] = request.addressIpVersion;
  }
  if (!$isNull(request.addressType)) {
    query['AddressType'] = request.addressType;
  }
  if (!$isNull(request.DNSName)) {
    query['DNSName'] = request.DNSName;
  }
  if (!$isNull(request.ipv6AddressType)) {
    query['Ipv6AddressType'] = request.ipv6AddressType;
  }
  if (!$isNull(request.loadBalancerBussinessStatus)) {
    query['LoadBalancerBussinessStatus'] = request.loadBalancerBussinessStatus;
  }
  if (!$isNull(request.loadBalancerIds)) {
    query['LoadBalancerIds'] = request.loadBalancerIds;
  }
  if (!$isNull(request.loadBalancerNames)) {
    query['LoadBalancerNames'] = request.loadBalancerNames;
  }
  if (!$isNull(request.loadBalancerStatus)) {
    query['LoadBalancerStatus'] = request.loadBalancerStatus;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.payType)) {
    query['PayType'] = request.payType;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.vpcIds)) {
    query['VpcIds'] = request.vpcIds;
  }
  if (!$isNull(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListLoadBalancers',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the configurations of instances.
 *
 * @param request ListLoadBalancersRequest
 * @return ListLoadBalancersResponse
 */
async function listLoadBalancers(request: ListLoadBalancersRequest): ListLoadBalancersResponse {
  var runtime = new $RuntimeOptions{};
  return listLoadBalancersWithOptions(request, runtime);
}

model ListRulesRequest {
  direction?: string(name='Direction', description='The direction to which the forwarding rule is applied. Valid values:

*   **Request** (default): The forwarding rule is applied to the client requests received by ALB.
*   **Response**: The forwarding rule is applied to the responses returned by backend servers.

> You cannot set this parameter to Response if you use basic ALB instances.', example='Request'),
  listenerIds?: [ string ](name='ListenerIds', description='The listener IDs.'),
  loadBalancerIds?: [ string ](name='LoadBalancerIds', description='The Application Load Balancer (ALB) instance IDs.'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return.

Valid values: **1 to 100**.

Default value: **20**. If you do not specify this parameter, the default value is used.

> This parameter is optional.', example='20'),
  nextToken?: string(name='NextToken', description='The starting point of the current query. If you do not specify this parameter, the query starts from the beginning.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  ruleIds?: [ string ](name='RuleIds', description='The forwarding rules.'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.', example='product'),
    }
  ](name='Tag', description='The tag.'),
}

model ListRulesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The maximum number of entries returned.', example='50'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  rules?: [ 
    {
      direction?: string(name='Direction', description='The direction to which the forwarding rule is applied. Valid values:

*   Request (default): The forwarding rule is applied to requests. The forwarding action is performed on packets that are forwarded from clients to ALB.
*   Responses: The forwarding rule is applied to responses. The forwarding action is performed on packets that are returned from backend servers to ALB.

>  Basic ALB instances support only the Response direction.', example='Request'),
      listenerId?: string(name='ListenerId', description='The ID of the listener that is associated with the forwarding rule.', example='lsn-i35udpz3pxsmnf****'),
      loadBalancerId?: string(name='LoadBalancerId', description='The ID of the Application Load Balancer (ALB) instance that is associated with the forwarding rule.', example='alb-x30o38azsuj0sx****'),
      priority?: int32(name='Priority', description='The priority of the forwarding rule. Valid values: **1 to 10000**. A smaller value indicates a higher priority.

>  The priority of each forwarding rule added to a listener must be unique.', example='1'),
      ruleActions?: [ 
        {
          corsConfig?: {
            allowCredentials?: string(name='AllowCredentials', description='Indicates whether credentials can be carried in CORS requests. Valid values:

*   **on**
*   **off**', example='on'),
            allowHeaders?: [ string ](name='AllowHeaders', description='The allowed headers of CORS requests.'),
            allowMethods?: [ string ](name='AllowMethods', description='The allowed HTTP methods of CORS requests.'),
            allowOrigin?: [ string ](name='AllowOrigin', description='The allowed origins of CORS requests.'),
            exposeHeaders?: [ string ](name='ExposeHeaders', description='The headers that can be exposed.'),
            maxAge?: long(name='MaxAge', description='The maximum cache time of dry runs in the browser. Unit: seconds.

Valid values: **-1** to **172800**.', example='1000'),
          }(name='CorsConfig', description='The CORS configuration.'),
          fixedResponseConfig?: {
            content?: string(name='Content', description='The content of the custom response. The content can be up to 1 KB in size, and can contain only ASCII characters.', example='dssacav'),
            contentType?: string(name='ContentType', description='The format of the response.

Valid values: **text/plain**, **text/css**, **text/html**, **application/javascript**, and **application/json**.', example='text/plain'),
            httpCode?: string(name='HttpCode', description='The HTTP status code in responses. Valid values: **HTTP_2xx**, **HTTP_4xx**, and **HTTP_5xx**. **x** is a digit.', example='HTTP_2xx'),
          }(name='FixedResponseConfig', description='The configuration of the custom response.'),
          forwardGroupConfig?: {
            serverGroupStickySession?: {
              enabled?: boolean(name='Enabled', description='If the value of N in ServerGroupTuple.N is larger than 1, you can enable or disable session persistence for server groups.', example='true'),
              timeout?: int32(name='Timeout', description='If Enabled is set to True, you can specify a session persistence timeout period.', example='100'),
            }(name='ServerGroupStickySession', description='The session persistence configurations of the server group.'),
            serverGroupTuples?: [ 
              {
                serverGroupId?: string(name='ServerGroupId', description='The server group to which requests are forwarded.', example='sg-atstuj3rtoptyui****'),
                weight?: int32(name='Weight', description='The weight of the server group. Valid values: **0** to **100**.', example='2'),
              }
            ](name='ServerGroupTuples', description='The server groups to which requests are forwarded.'),
          }(name='ForwardGroupConfig', description='The configurations of the server groups.'),
          insertHeaderConfig?: {
            key?: string(name='Key', description='The key of the header. The header key must be 1 to 40 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The header key specified in `InsertHeader` must be unique.

>  **Cookie** and **Host** are not supported.', example='key'),
            value?: string(name='Value', description='The value of the header to be inserted.

*   If **ValueType** is set to **SystemDefined**, you can set the Value parameter to one of the following values:

    *   **ClientSrcPort**: the client port.
    *   **ClientSrcIp**: the IP address of the client.
    *   **Protocol**: the request protocol (HTTP or HTTPS).
    *   **SLBId**: the ID of the ALB instance.
    *   **SLBPort**: the listener port.

*   If **ValueType** is set to **UserDefined**, you can specify a custom header value. The header value must be 1 to 128 characters in length, and can contain wildcard characters, such as asterisks (\\\\*) and question marks (?), and printable characters whose ASCII values are `larger than or equal to 32 and smaller than 127`. The header value cannot start or end with a space character.

*   If **ValueType** is set to **ReferenceHeader**, you can reference a value from a request header. The header value must be 1 to 128 characters in length, and can contain lowercase letters, digits, hyphens (-), and underscores (_).', example='ClientSrcPort'),
            valueType?: string(name='ValueType', description='The type of the header value. Valid values:

*   **UserDefined**: a user-defined header value.
*   **ReferenceHeader**: a header value that is referenced from a request header.
*   **SystemDefined:** a system-defined header value.', example='SystemDefined'),
          }(name='InsertHeaderConfig', description='The key of the header to be inserted.'),
          order?: int32(name='Order', description='The priority of the action. Valid values: **1 to 50000**. A smaller value indicates a higher priority. The actions of a forwarding rule are applied in descending order of priority. This parameter cannot empty. The priority of each action within a forwarding rule must be unique.', example='1'),
          redirectConfig?: {
            host?: string(name='Host', description='The hostname to which requests are redirected. Valid values:

*   **${host}** (default): If ${host} is returned, no other characters are appended.

*   A custom value. Make sure that the custom value meets the following requirements:

    *   The hostname must be 3 to 128 characters in length, and can contain lowercase letters, digits, hyphens (-), periods (.), asterisks (\\\\*), and question marks (?).
    *   The hostname must contain at least one period (.) but cannot start or end with a period (.).
    *   The rightmost domain label can contain only letters and wildcard characters. It cannot contain digits or hyphens (-).
    *   The domain labels cannot start or end with a hyphen (-).
    *   You can use asterisks (\\\\*) and question marks (?) anywhere in a domain label as wildcard characters.', example='www.example.com'),
            httpCode?: string(name='HttpCode', description='The forwarding method. Valid values: **301**, **302**, **303**, **307**, and **308**.', example='301'),
            path?: string(name='Path', description='The URL to which requests are redirected. Valid values:

*   **${path}** (default): You can reference \\\\*\\\\*${host}**, **${protocol}**, and**${port}**. The URL can consist of **${host}**,**${protocol}**, and **${port}\\\\*\\\\*. Each variable can be used only once. The preceding variables can be used at the same time or combined with a custom value.

*   A custom value. Make sure that the custom value meets the following requirements:

    *   The URL must be 1 to 128 characters in length.
    *   It must start with a forward slash (/) and can contain letters, digits, and the following special characters: `$ - _ .+ / & ~ @ :`. It cannot contain the following special characters: `" % # ; ! ( ) [ ] ^ , "`. You can use asterisks (\\\\*) and question marks (?) as wildcard characters.', example='/test'),
            port?: string(name='Port', description='The port to which requests are redirected. Valid values:

*   **${port}** (default): If ${port} is returned, no other characters are appended.
*   Other valid values: **1 to 63335**.', example='10'),
            protocol?: string(name='Protocol', description='The redirect protocol. Valid values:

*   **${protocol}** (default): If ${protocol} is returned, no other characters are appended.
*   **HTTP** or **HTTPS**

>  HTTPS listeners supports only HTTPS redirects.', example='HTTP'),
            query?: string(name='Query', description='The query string of the URL to which requests are redirected. The query string must be 1 to 128 characters in length, and can contain printable characters, excluding uppercase letters and the following special characters: `# [ ] { } \\\\ | < > &`.', example='quert'),
          }(name='RedirectConfig', description='The configuration of the redirect action.'),
          removeHeaderConfig?: {
            key?: string(name='Key', description='The key of the header to be removed. The header key must be 1 to 40 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The header keys specified in RemoveHeader must be unique.

*   If Direction is set to Request, the specified headers are removed from requests. The following header keys are not supported (not case-sensitive): `slb-id`, `slb-ip`, `x-forwarded-for`, `x-forwarded-proto`, `x-forwarded-eip`, `x-forwarded-port`, `x-forwarded-client-srcport`, `connection`, `upgrade`, `content-length`, `transfer-encoding`, `keep-alive`, `te`, `host`, `cookie`, `remoteip`, and `authority`.
*   If Direction is set to Response, the specified headers are removed from responses. The following header keys are not supported (not case-sensitive): `connection`, `upgrade`, `content-length`, and `transfer-encoding`.', example='key'),
          }(name='RemoveHeaderConfig', description='The HTTP header to be removed.'),
          rewriteConfig?: {
            host?: string(name='Host', description='The hostname to which requests are redirected. Valid values:

*   **${host}** (default): If ${host} is returned, no other characters are appended.

*   A custom value. Make sure that the custom value meets the following requirements:

    *   The hostname must be 3 to 128 characters in length, and can contain lowercase letters, digits, hyphens (-), periods (.), asterisks (\\\\*), and question marks (?).
    *   The hostname must contain at least one period (.) but cannot start or end with a period (.).
    *   The rightmost domain label can contain only letters and wildcard characters. It cannot contain digits or hyphens (-).
    *   The domain labels cannot start or end with a hyphen (-).
    *   You can use asterisks (\\\\*) and question marks (?) anywhere in a domain label as wildcard characters.', example='www.example.com'),
            path?: string(name='Path', description='The URL to which requests are redirected. The URL must be 1 to 128 characters in length, and can contain letters, digits, asterisks (\\\\*), question marks (?), and the following special characters: `$ - _ . + / & ~ @ :`. It must start with a forward slash (/) and does not contain the following special characters: `" % # ; ! ( ) [ ] ^ , "`.', example='/tsdf'),
            query?: string(name='Query', description='The query string of the URL to which requests are redirected. The query string must be 1 to 128 characters in length, and can contain printable characters, excluding uppercase letters and the following special characters: `# [ ] { } \\\\ | < > &`.', example='quedsa'),
          }(name='RewriteConfig', description='The configuration of the rewrite action.'),
          trafficLimitConfig?: {
            perIpQps?: int32(name='PerIpQps', description='The number of requests per IP address. Valid values: **1 to 100000**.

>  If both the **QPS** and **PerIpQps** parameters are specified, the value of the **QPS** parameter is smaller than the value of the PerIpQps parameter.', example='80'),
            QPS?: int32(name='QPS', description='The number of queries per second (QPS). Valid values: **1** to **100000**.', example='4'),
          }(name='TrafficLimitConfig', description='The configuration of traffic throttling.'),
          trafficMirrorConfig?: {
            mirrorGroupConfig?: {
              serverGroupTuples?: [ 
                {
                  serverGroupId?: string(name='ServerGroupId', description='The ID of the server group.', example='srg-00mkgijak0w4qgz9****'),
                  weight?: int32(name='Weight', description='The weight of the server group. Valid values: **0** to **100**.', example='2'),
                }
              ](name='ServerGroupTuples', description='The server group to which traffic is mirrored.'),
            }(name='MirrorGroupConfig', description='The configuration of the server group to which traffic is mirrored.'),
            targetType?: string(name='TargetType', description='The destination to which traffic is mirrored. The destination can be a server group.', example='ForwardGroupMirror'),
          }(name='TrafficMirrorConfig', description='The configuration of traffic mirroring.'),
          type?: string(name='Type', description='The action. Valid values:

*   **ForwardGroup**: distributes requests to multiple vServer groups.
*   **Redirect**: redirects requests.
*   **FixedResponse**: returns a custom response.
*   **Rewrite**: rewrites requests.
*   **InsertHeader**: inserts headers.
*   **RemoveHeaderConfig**: removes headers.
*   **TrafficLimitConfig**: throttles network traffic.
*   **TrafficMirrorConfig**: mirrors network traffic.
*   **CorsConfig**: forwards requests based on CORS.

The preceding actions can be classified into two broad types:

*   **FinalType**: Each forwarding rule can contain only one FinalType action, which is performed at the end. You can specify only one of **ForwardGroup**, **Redirect**, and **FixedResponse**.
*   **ExtType**: Each forwarding rule can contain one or more **ExtType** actions, which are performed before the **FinalType** action. If you want to specify an ExtType action, you must also specify a **FinalType** action. You can specify multiple **InsertHeader** actions or one **Rewrite** action.', example='ForwardGroup'),
        }
      ](name='RuleActions', description='The action of the forwarding rule.'),
      ruleConditions?: [ 
        {
          cookieConfig?: {
            values?: [ 
              {
                key?: string(name='Key', description='The cookie key. The cookie key must be 1 to 100 characters in length, and can contain lowercase letters, printable ASCII characters, asterisks (\\\\*), and question marks (?). It cannot contain space characters or the following special characters: `# [ ] { } \\\\ | < > &`.', example='test'),
                value?: string(name='Value', description='The cookie value. The cookie value must be 1 to 128 characters in length, and can contain lowercase letters, printable ASCII characters, asterisks (\\\\*), and question marks (?). It cannot contain space characters or the following special characters: `# [ ] { } \\\\ | < > &`.', example='test'),
              }
            ](name='Values', description='The cookie value.'),
          }(name='CookieConfig', description='The key-value pairs of the cookie.'),
          headerConfig?: {
            key?: string(name='Key', description='The key of the header. The header key must be 1 to 40 characters in length. It can contain letters, digits, hyphens (-), and underscores (_). Cookie and Host are not supported.', example='Port'),
            values?: [ string ](name='Values', description='The value of the header.'),
          }(name='HeaderConfig', description='The configuration of the header.'),
          hostConfig?: {
            values?: [ string ](name='Values', description='The hostnames.'),
          }(name='HostConfig', description='The configuration of the hosts.'),
          methodConfig?: {
            values?: [ string ](name='Values', description='The request methods.'),
          }(name='MethodConfig', description='The configurations of the request methods.'),
          pathConfig?: {
            values?: [ string ](name='Values', description='The URLs to which requests are forwarded.'),
          }(name='PathConfig', description='The configurations of the forwarding URLs.'),
          queryStringConfig?: {
            values?: [ 
              {
                key?: string(name='Key', description='They key of the query string. The key must be 1 to 100 characters in length, and can contain lowercase letters, printable ASCII characters, asterisks (\\\\*), and question marks (?). It cannot contain space characters or the following special characters: `# [ ] { } \\\\ | < > &`.', example='test'),
                value?: string(name='Value', description='The value of the query string. The value must be 1 to 128 characters in length, and can contain lowercase letters, printable ASCII characters, asterisks (\\\\*), and question marks (?). It cannot contain space characters or the following special characters: `# [ ] { } \\\\ | < > &`.', example='test'),
              }
            ](name='Values', description='The query string.'),
          }(name='QueryStringConfig', description='The configurations of the query strings.'),
          responseHeaderConfig?: {
            key?: string(name='Key', description='The key of the HTTP header. The header key must be 1 to 40 characters in length, It can contain letters, digits, hyphens (-), and underscores (_). Cookie and Host are not supported.', example='key'),
            values?: [ string ](name='Values', description='The values of the HTTP header.'),
          }(name='ResponseHeaderConfig', description='The HTTP header in responses.'),
          responseStatusCodeConfig?: {
            values?: [ string ](name='Values', description='The response status codes.'),
          }(name='ResponseStatusCodeConfig', description='The configurations of the response status codes.'),
          sourceIpConfig?: {
            values?: [ string ](name='Values', description='The source IP addresses.'),
          }(name='SourceIpConfig', description='Traffic matching based on source IP addresses.'),
          type?: string(name='Type', description='The type of forwarding rule. Valid values:

*   **Host**: Responses are forwarded based on hosts.
*   **Path**: Responses are forwarded based on URLs.
*   **Header**: Responses are forwarded based on HTTP headers.
*   **QueryString**: Responses are forwarded based on query strings.
*   **Method**: Responses are forwarded based on request methods.
*   **Cookie**: Responses are forwarded based on cookies.
*   **SourceIp**: Responses are forwarded based on source IP addresses.', example='Host'),
        }
      ](name='RuleConditions', description='The conditions of the forwarding rule.'),
      ruleId?: string(name='RuleId', description='The ID of the forwarding rule.', example='rule-bpn0kn908w4nbw****'),
      ruleName?: string(name='RuleName', description='The name of the forwarding rule. The name must be 2 to 128 letters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='rule-instance-test'),
      ruleStatus?: string(name='RuleStatus', description='The status of the forwarding rule. Valid values:

*   **Provisioning**: The forwarding rule is being created.
*   **Configuring**: The forwarding rule is being modified.
*   **Available**: The forwarding rule is available.', example='Available'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.', example='env'),
          value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.', example='product'),
        }
      ](name='Tags', description='The tags.'),
    }
  ](name='Rules', description='The details about the forwarding rule.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1000'),
}

model ListRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRulesResponseBody(name='body'),
}

/**
 * @summary Queries the forwarding rules in a region.
 *
 * @param request ListRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRulesResponse
 */
async function listRulesWithOptions(request: ListRulesRequest, runtime: $RuntimeOptions): ListRulesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.direction)) {
    query['Direction'] = request.direction;
  }
  if (!$isNull(request.listenerIds)) {
    query['ListenerIds'] = request.listenerIds;
  }
  if (!$isNull(request.loadBalancerIds)) {
    query['LoadBalancerIds'] = request.loadBalancerIds;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.ruleIds)) {
    query['RuleIds'] = request.ruleIds;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListRules',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the forwarding rules in a region.
 *
 * @param request ListRulesRequest
 * @return ListRulesResponse
 */
async function listRules(request: ListRulesRequest): ListRulesResponse {
  var runtime = new $RuntimeOptions{};
  return listRulesWithOptions(request, runtime);
}

model ListSecurityPoliciesRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: **1** to **100**. Default value: **20**.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of **NextToken**.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-atstuj3rtop****'),
  securityPolicyIds?: [ string ](name='SecurityPolicyIds', description='The security policy IDs. You can specify at most 20 security policies.'),
  securityPolicyNames?: [ string ](name='SecurityPolicyNames', description='The names of the security policies. You can specify up to 10 names.'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tag', description='The tags.'),
}

model ListSecurityPoliciesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='50'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  securityPolicies?: [ 
    {
      ciphers?: [ string ](name='Ciphers', description='The supported cipher suites.'),
      createTime?: string(name='CreateTime', description='The time when the ACL was created. The time follows the `YYYY-MM-DDThh:mm:ssZ` format.', example='2023-02-15T07:37:33Z'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-atstuj3rtop****'),
      securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the security policy.', example='rg-atstuj3rtop****'),
      securityPolicyName?: string(name='SecurityPolicyName', description='The name of the security policy.', example='test-secrity'),
      securityPolicyStatus?: string(name='SecurityPolicyStatus', description='The status of the security policy. Valid values:

*   **Configuring**
*   **Available**', example='Available'),
      TLSVersions?: [ string ](name='TLSVersions', description='The supported TLS protocol versions.'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.', example='env'),
          value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.', example='product'),
        }
      ](name='Tags', description='The tags.'),
    }
  ](name='SecurityPolicies', description='The supported security policies.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1000'),
}

model ListSecurityPoliciesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSecurityPoliciesResponseBody(name='body'),
}

/**
 * @summary Queries custom security policies in a region.
 *
 * @param request ListSecurityPoliciesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSecurityPoliciesResponse
 */
async function listSecurityPoliciesWithOptions(request: ListSecurityPoliciesRequest, runtime: $RuntimeOptions): ListSecurityPoliciesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.securityPolicyIds)) {
    query['SecurityPolicyIds'] = request.securityPolicyIds;
  }
  if (!$isNull(request.securityPolicyNames)) {
    query['SecurityPolicyNames'] = request.securityPolicyNames;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSecurityPolicies',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries custom security policies in a region.
 *
 * @param request ListSecurityPoliciesRequest
 * @return ListSecurityPoliciesResponse
 */
async function listSecurityPolicies(request: ListSecurityPoliciesRequest): ListSecurityPoliciesResponse {
  var runtime = new $RuntimeOptions{};
  return listSecurityPoliciesWithOptions(request, runtime);
}

model ListSecurityPolicyRelationsRequest {
  securityPolicyIds?: [ string ](name='SecurityPolicyIds', description='The security policy IDs. You can specify up to five IDs.

This parameter is required.'),
}

model ListSecurityPolicyRelationsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  secrityPolicyRelations?: [ 
    {
      relatedListeners?: [ 
        {
          listenerId?: string(name='ListenerId', description='The listener ID.', example='lsn-0bfuc****'),
          listenerPort?: long(name='ListenerPort', description='The listener port.', example='80'),
          listenerProtocol?: string(name='ListenerProtocol', description='The listener protocol.', example='HTTPS'),
          loadBalancerId?: string(name='LoadBalancerId', description='The Server Load Balancer (SLB) instance ID.', example='lb-bp1o94dp5i6ea****'),
        }
      ](name='RelatedListeners', description='The listeners that are associated with the security policy.'),
      securityPolicyId?: string(name='SecurityPolicyId', description='The security policy ID.', example='scp-bp1bpn0kn9****'),
    }
  ](name='SecrityPolicyRelations', description='The security policies and the listeners that are associated with the security policies.'),
}

model ListSecurityPolicyRelationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSecurityPolicyRelationsResponseBody(name='body'),
}

/**
 * @summary Queries the listeners that are associated with security policies.
 *
 * @param request ListSecurityPolicyRelationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSecurityPolicyRelationsResponse
 */
async function listSecurityPolicyRelationsWithOptions(request: ListSecurityPolicyRelationsRequest, runtime: $RuntimeOptions): ListSecurityPolicyRelationsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.securityPolicyIds)) {
    query['SecurityPolicyIds'] = request.securityPolicyIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSecurityPolicyRelations',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the listeners that are associated with security policies.
 *
 * @param request ListSecurityPolicyRelationsRequest
 * @return ListSecurityPolicyRelationsResponse
 */
async function listSecurityPolicyRelations(request: ListSecurityPolicyRelationsRequest): ListSecurityPolicyRelationsResponse {
  var runtime = new $RuntimeOptions{};
  return listSecurityPolicyRelationsWithOptions(request, runtime);
}

model ListServerGroupServersRequest {
  maxResults?: int32(name='MaxResults', description='The maximum number of entries to return. Valid values: **1** to **100**. If you do not specify a value, the default value **20** is used.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of **NextToken**.', example='FFmyTO70tTpLG6I3FmYAXG****'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.', example='rg-atstuj3rtop****'),
  serverIds?: [ string ](name='ServerIds', description='The IDs of the servers.'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. You can specify up to 10 tag keys.

The tag key can be up to 64 characters in length, and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.', example='Test'),
      value?: string(name='Value', description='The tag value. You can specify up to 10 tag values.

The tag value can be up to 128 characters in length, and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.', example='Test'),
    }
  ](name='Tag', description='The tags that are added to the server group. You can specify up to 10 tags in each call.'),
}

model ListServerGroupServersResponseBody = {
  maxResults?: int32(name='MaxResults', description='The maximum number of entries returned.', example='50'),
  nextToken?: string(name='NextToken', description='The returned value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If **NextToken** is not empty, the value of NextToken can be used in the next request to retrieve a new page of results.', example='caeba0bbb2be03f8****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  servers?: [ 
    {
      description?: string(name='Description', description='The description of the backend server.', example='test'),
      port?: int32(name='Port', description='The port used by the backend server. Valid values: **1** to **65535**.', example='80'),
      remoteIpEnabled?: boolean(name='RemoteIpEnabled', description='Indicates whether the remote IP address feature is enabled. Valid values:

*   **true**
*   **false**', example='true'),
      serverGroupId?: string(name='ServerGroupId', description='The ID of the server group.', example='sgp-qy042e1jabmprh****'),
      serverId?: string(name='ServerId', description='The ID of the backend server.

> If **ServerType** is set to **Fc**, **ServerId** is the ARN of a function.', example='i-bp1f9kdprbgy9uiu****'),
      serverIp?: string(name='ServerIp', description='The IP address in inclusive ENI mode.', example='192.168.XX.XX'),
      serverType?: string(name='ServerType', description='The type of the backend server.', example='Ecs'),
      status?: string(name='Status', description='The status of the backend server. Valid values:

*   **Adding**
*   **Available**
*   **Configuring**
*   **Removing**', example='Available'),
      weight?: int32(name='Weight', description='The weight of the backend server. An ECS instance with a higher weight receives more requests.', example='100'),
    }
  ](name='Servers', description='A list of backend servers.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='3'),
}

model ListServerGroupServersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServerGroupServersResponseBody(name='body'),
}

/**
 * @summary Queries servers in a server group.
 *
 * @param request ListServerGroupServersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServerGroupServersResponse
 */
async function listServerGroupServersWithOptions(request: ListServerGroupServersRequest, runtime: $RuntimeOptions): ListServerGroupServersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.serverGroupId)) {
    query['ServerGroupId'] = request.serverGroupId;
  }
  if (!$isNull(request.serverIds)) {
    query['ServerIds'] = request.serverIds;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListServerGroupServers',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries servers in a server group.
 *
 * @param request ListServerGroupServersRequest
 * @return ListServerGroupServersResponse
 */
async function listServerGroupServers(request: ListServerGroupServersRequest): ListServerGroupServersResponse {
  var runtime = new $RuntimeOptions{};
  return listServerGroupServersWithOptions(request, runtime);
}

model ListServerGroupsRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: **1** to **100**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of **NextToken**.', example='FFmyTO70tTpLG6I3FmYAXG****'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the server group belongs.', example='rg-atstuj3rtop****'),
  serverGroupIds?: [ string ](name='ServerGroupIds', description='The server group IDs.'),
  serverGroupNames?: [ string ](name='ServerGroupNames', description='The names of the server groups to be queried. You can specify at most 10 server group names.'),
  serverGroupType?: string(name='ServerGroupType', description='The server group type. Valid values:

*   **Instance**: instances, including ECS instances, ENIs, and elastic container instances.
*   **Ip**: IP addresses.
*   **Fc**: Function Compute', example='Instance'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. You can specify up to 10 tag keys.

The tag key can be up to 64 characters in length and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.', example='Test'),
      value?: string(name='Value', description='The tag value. You can specify up to 10 tag values.

The tag value can be up to 128 characters in length, and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.', example='Test'),
    }
  ](name='Tag', description='The tags that are added to the server group. You can specify up to 10 tags in each call.', example='Instance'),
  vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC).', example='vpc-bp15zckdt37pq72zv****'),
}

model ListServerGroupsResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='50'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If **NextToken** is not empty, the value of NextToken can be used in the next request to retrieve a new page of results.', example='caeba0bbb2be03f8****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  serverGroups?: [ 
    {
      configManagedEnabled?: boolean(name='ConfigManagedEnabled', description='Indicates whether configuration management is enabled. Valid values:

*   **true**
*   **false**', example='false'),
      connectionDrainConfig?: {
        connectionDrainEnabled?: boolean(name='ConnectionDrainEnabled', description='Indicates whether connection draining is enabled. Valid values:

*   **true**
*   **false**', example='false'),
        connectionDrainTimeout?: int32(name='ConnectionDrainTimeout', description='The timeout period of connection draining.', example='300'),
      }(name='ConnectionDrainConfig', description='The configurations of connection draining.

After connection draining is enabled, ALB maintains data transmission for a period of time after the backend server is removed or declared unhealthy.
> 
> - Basic ALB instances do not support connection draining. Standard and WAF-enabled ALB instances support connection draining. 
> -  Server groups of the instance and IP types support connection draining. Server groups of the Function Compute type do not support connection draining.'),
      createTime?: string(name='CreateTime', description='The time when the resource was created.', example='2022-07-02T02:49:05Z'),
      crossZoneEnabled?: boolean(name='CrossZoneEnabled', description='Indicates whether cross-zone load balancing is enabled. Valid values:

*   **true** (default)
*   **false**', example='true'),
      healthCheckConfig?: {
        healthCheckCodes?: [ string ](name='HealthCheckCodes', description='The HTTP status codes that indicate healthy backend servers.'),
        healthCheckConnectPort?: int32(name='HealthCheckConnectPort', description='The backend port that is used for health checks. Valid values: **0** to **65535**.

A value of **0** indicates that the port of a backend server is used for health checks.', example='80'),
        healthCheckEnabled?: boolean(name='HealthCheckEnabled', description='Indicates whether the health check feature is enabled. Valid values:

*   **true**
*   **false**', example='true'),
        healthCheckHost?: string(name='HealthCheckHost', description='The domain name that is used for health checks.

*   **Backend Server Internal IP** (default): Use the internal IP address of backend servers as the health check domain name.

*   **Custom Domain Name**: Enter a domain name.

    *   The domain name is 1 to 80 characters in length.
    *   The domain name contains lowercase letters, digits, hyphens (-), and periods (.).
    *   The domain name contains at least one period (.) but does not start or end with a period (.).
    *   The rightmost domain label of the domain name contains only letters, and does not contain digits or hyphens (-).
    *   The domain name does not start or end with a hyphen (-).

>  This parameter takes effect only if HealthCheckProtocol is set to HTTP, HTTPS, or gRPC.', example='www.example.com'),
        healthCheckHttpVersion?: string(name='HealthCheckHttpVersion', description='The HTTP version that is used for health checks.

Valid values: **HTTP1.0** and **HTTP1.1**.

>  This parameter takes effect only if **HealthCheckProtocol** is set to **HTTP** or **HTTPS**.', example='HTTP1.1'),
        healthCheckInterval?: int32(name='HealthCheckInterval', description='The interval at which health checks are performed. Unit: seconds. Valid values: **1** to **50**.', example='5'),
        healthCheckMethod?: string(name='HealthCheckMethod', description='The HTTP method that is used for health checks. Valid values:

*   **GET**: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.
*   **POST**: gRPC health checks use the POST method by default.
*   **HEAD**: HTTP and HTTPS health checks use the HEAD method by default.

>  This parameter takes effect only if **HealthCheckProtocol** is set to **HTTP**, **HTTPS**, or **gRPC**.', example='HEAD'),
        healthCheckPath?: string(name='HealthCheckPath', description='The URL that is used for health checks.

>  This parameter takes effect only if **HealthCheckProtocol** is set to **HTTP** or **HTTPS**.', example='/test/index.html'),
        healthCheckProtocol?: string(name='HealthCheckProtocol', description='The protocol that is used for health checks. Valid values:

*   **HTTP**: HTTP health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers.
*   **HTTPS**: HTTPS health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers. HTTPS supports encryption and provides higher security than HTTP.
*   **TCP**: TCP health checks send TCP SYN packets to a backend server to check whether the port of the backend server is reachable.
*   **gRPC**: gRPC health checks send POST or GET requests to a backend server to check whether the backend server is healthy.', example='HTTP'),
        healthCheckTimeout?: int32(name='HealthCheckTimeout', description='The timeout period of a health check response. If a backend server does not respond within the specified timeout period, the backend server is declared unhealthy. Unit: seconds.', example='3'),
        healthyThreshold?: int32(name='HealthyThreshold', description='The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status is changed from **fail** to **success**.', example='4'),
        unhealthyThreshold?: int32(name='UnhealthyThreshold', description='The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status is changed from **success** to **fail**.', example='4'),
      }(name='HealthCheckConfig', description='The health check configurations.'),
      ipv6Enabled?: boolean(name='Ipv6Enabled', description='Indicates whether IPv6 is supported. Valid values:

*   **true**
*   **false**', example='false'),
      protocol?: string(name='Protocol', description='The backend protocol. Valid values:

*   **HTTP**: allows you to associate HTTPS, HTTP, or QUIC listeners with backend servers.
*   **HTTPS**: allows you to associate HTTPS listeners with backend servers.
*   **GRPC**: allows you to associate HTTPS and QUIC listeners with backend servers.', example='HTTP'),
      relatedLoadBalancerIds?: [ string ](name='RelatedLoadBalancerIds', description='The ID of the ALB instance associated with the server group.'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.', example='rg-atstuj3rtop****'),
      scheduler?: string(name='Scheduler', description='The scheduling algorithm. Valid values:

*   **Wrr**: weighted round-robin. Backend servers with higher weights receive more requests than backend servers with lower weights.
*   **Wlc**: weighted least connections. Requests are distributed based on the weight and load of each backend server. The load refers to the number of connections on a backend server. If multiple backend servers have the same weight, requests are forwarded to the backend server with the least number of connections.
*   **Sch**: consistent hashing. Requests that have the same hash factors are distributed to the same backend server. If you do not specify the UchConfig parameter, the source IP address is used as the hash factor by default. Requests that are from the same IP address are distributed to the same backend server. If you specify the UchConfig parameter, the URL string is used as the hash factor. Requests that have the same URL string are distributed to the same backend server.', example='Wrr'),
      serverCount?: int32(name='ServerCount', description='The number of backend servers in the server group.', example='1'),
      serverGroupId?: string(name='ServerGroupId', description='The server group ID.', example='sgp-cige6j****'),
      serverGroupName?: string(name='ServerGroupName', description='The server group name.', example='Group3'),
      serverGroupStatus?: string(name='ServerGroupStatus', description='The status of the server group. Valid values:

*   **Creating**.
*   **Available**
*   **Configuring**', example='Available'),
      serverGroupType?: string(name='ServerGroupType', description='The server group type. Valid values:

*   **Instance**: instances, including ECS instances, ENIs, and elastic container instances.
*   **Ip**: IP addresses.
*   **Fc**: Function Compute', example='Instance'),
      serviceName?: string(name='ServiceName', description='The name of the server group.', example='test'),
      slowStartConfig?: {
        slowStartDuration?: int32(name='SlowStartDuration', description='The duration of a slow start.', example='30'),
        slowStartEnabled?: boolean(name='SlowStartEnabled', description='Indicates whether slow starts are enabled. Valid values:

*   **true**
*   **false**', example='false'),
      }(name='SlowStartConfig', description='The configurations of slow starts.

After slow starts are enabled, ALB prefetches data to newly added backend servers. Requests distributed to the backend servers gradually increase.

> 
> - Basic ALB instances do not support slow starts. Standard and WAF-enabled ALB instances support slow starts.
> - Server groups of the instance and IP types support slow starts. Server groups of the Function Compute type do not support slow starts.
> - Slow start is supported only by the weighted round-robin scheduling algorithm.'),
      stickySessionConfig?: {
        cookie?: string(name='Cookie', description='The cookie configured for the server.', example='B490B5EBF6F3CD402E515D22BCDA****'),
        cookieTimeout?: int32(name='CookieTimeout', description='The timeout period of the cookie. Unit: seconds. Valid values: **1** to **86400**.

>  This parameter takes effect only when **StickySessionEnabled** is set to **true** and **StickySessionType** is set to **Insert**.', example='1000'),
        stickySessionEnabled?: boolean(name='StickySessionEnabled', description='Indicates whether session persistence is enabled. Valid values:

*   **true**
*   **false**', example='false'),
        stickySessionType?: string(name='StickySessionType', description='The method that is used to handle the cookie. Valid values:

*   **insert**: inserts the cookie. The first time a client accesses ALB, ALB inserts the SERVERID cookie into the HTTP or HTTPS response packet. Subsequent requests from the client that carry this cookie are forwarded to the same backend server as the first request.
*   **Server**: rewrites the cookie. ALB rewrites the custom cookies in requests from a client. Subsequent requests from the client that carry the new cookie are forwarded to the same backend server as the first request.', example='Insert'),
      }(name='StickySessionConfig', description='The configuration of session persistence.'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='Test'),
          value?: string(name='Value', description='The tag value.', example='Test'),
        }
      ](name='Tags', description='The tags that are added to the server group.'),
      uchConfig?: {
        type?: string(name='Type', description='The parameter type. Valid value: QueryString.', example='QueryString'),
        value?: string(name='Value', description='The hash value.', example='abc'),
      }(name='UchConfig', description='The configuration of consistent hashing based on URLs.'),
      upstreamKeepaliveEnabled?: boolean(name='UpstreamKeepaliveEnabled', description='Indicates whether persistent TCP connections are enabled. Valid values:

*   **true**
*   **false**', example='false'),
      vpcId?: string(name='VpcId', description='The ID of the VPC to which the ALB instance belongs.', example='vpc-bp15zckdt37pq72zv****'),
    }
  ](name='ServerGroups', description='The server groups.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1000'),
}

model ListServerGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServerGroupsResponseBody(name='body'),
}

/**
 * @summary Queries server groups.
 *
 * @param request ListServerGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServerGroupsResponse
 */
async function listServerGroupsWithOptions(request: ListServerGroupsRequest, runtime: $RuntimeOptions): ListServerGroupsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.serverGroupIds)) {
    query['ServerGroupIds'] = request.serverGroupIds;
  }
  if (!$isNull(request.serverGroupNames)) {
    query['ServerGroupNames'] = request.serverGroupNames;
  }
  if (!$isNull(request.serverGroupType)) {
    query['ServerGroupType'] = request.serverGroupType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListServerGroups',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries server groups.
 *
 * @param request ListServerGroupsRequest
 * @return ListServerGroupsResponse
 */
async function listServerGroups(request: ListServerGroupsRequest): ListServerGroupsResponse {
  var runtime = new $RuntimeOptions{};
  return listServerGroupsWithOptions(request, runtime);
}

model ListSystemSecurityPoliciesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  securityPolicies?: [ 
    {
      ciphers?: [ string ](name='Ciphers', description='The supported cipher suite.'),
      securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the security policy.', example='spy-n0kn923****'),
      TLSVersions?: [ string ](name='TLSVersions', description='The supported TLS protocol versions.'),
    }
  ](name='SecurityPolicies', description='The security policies.'),
}

model ListSystemSecurityPoliciesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSystemSecurityPoliciesResponseBody(name='body'),
}

/**
 * @summary Queries system security policies in a region.
 *
 * @param request ListSystemSecurityPoliciesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSystemSecurityPoliciesResponse
 */
async function listSystemSecurityPoliciesWithOptions(runtime: $RuntimeOptions): ListSystemSecurityPoliciesResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'ListSystemSecurityPolicies',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries system security policies in a region.
 *
 * @return ListSystemSecurityPoliciesResponse
 */
async function listSystemSecurityPolicies(): ListSystemSecurityPoliciesResponse {
  var runtime = new $RuntimeOptions{};
  return listSystemSecurityPoliciesWithOptions(runtime);
}

model ListTagKeysRequest {
  category?: string(name='Category', description='The type of the tag.

Valid values: **Custom**, **System**, and **All**.

Default value: **All**.', example='System'),
  keyword?: string(name='Keyword', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='test'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: **1** to **100**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of **NextToken**.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Valid values:

*   **acl**: an access control list (ACL)
*   **loadbalancer**: an Application Load Balancer (ALB) instance
*   **securitypolicy**: a security policy
*   **servergroup**: a server group

This parameter is required.', example='loadbalancer'),
}

model ListTagKeysResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  tagKeys?: [ 
    {
      category?: string(name='Category', description='The type of the tag.

Valid values: **Custom**, **System**, and **All**.

Default value: **All**.', example='System'),
      tagKey?: string(name='TagKey', description='The tag that matches all filter conditions.', example='test'),
    }
  ](name='TagKeys', description='The tag keys.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model ListTagKeysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagKeysResponseBody(name='body'),
}

/**
 * @summary Queries tag keys.
 *
 * @param request ListTagKeysRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagKeysResponse
 */
async function listTagKeysWithOptions(request: ListTagKeysRequest, runtime: $RuntimeOptions): ListTagKeysResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.category)) {
    query['Category'] = request.category;
  }
  if (!$isNull(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTagKeys',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries tag keys.
 *
 * @param request ListTagKeysRequest
 * @return ListTagKeysResponse
 */
async function listTagKeys(request: ListTagKeysRequest): ListTagKeysResponse {
  var runtime = new $RuntimeOptions{};
  return listTagKeysWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: **1** to **100**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of **NextToken**.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  resourceId?: [ string ](name='ResourceId', description='The resource IDs.', example='acl-123'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Valid values:

*   **acl**: an access control list (ACL)
*   **loadbalancer**: an Application Load Balancer (ALB) instance
*   **securitypolicy**: a security policy
*   **servergroup**: a server group

This parameter is required.', example='loadbalancer'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tag', description='The tags.', example='test'),
}

model ListTagResourcesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  tagResources?: [ 
    {
      resourceId?: string(name='ResourceId', description='The resource ID.', example='d-2ze1ot4ah7xjyv0d****'),
      resourceType?: string(name='ResourceType', description='The type of the resource. Valid values:

*   **acl**: an ACL
*   **loadbalancer**: an ALB instance
*   **securitypolicy**: a security policy
*   **servergroup**: a server group', example='loadbalancer'),
      tagKey?: string(name='TagKey', description='The tag key.', example='env'),
      tagValue?: string(name='TagValue', description='The tag value.', example='product'),
    }
  ](name='TagResources', description='The tags that match the specified keys and values.'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the tags of resources.
 *
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: $RuntimeOptions): ListTagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTagResources',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the tags of resources.
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model ListTagValuesRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: **1** to **100**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of **NextToken**.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  resourceId?: string(name='ResourceId', description='The resource ID.', example='eip-resource-test'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Valid values:

*   **loadbalancer**: an Application Load Balancer (ALB) instance
*   **acl**: an access control list (ACL)
*   **securitypolicy**: a security policy
*   **servergroup**: a server group', example='loadbalancer'),
  tagKey?: string(name='TagKey', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.

This parameter is required.', example='test'),
}

model ListTagValuesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  tagValues?: [ string ](name='TagValues', description='The tag values.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model ListTagValuesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagValuesResponseBody(name='body'),
}

/**
 * @summary Queries tag values.
 *
 * @param request ListTagValuesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagValuesResponse
 */
async function listTagValuesWithOptions(request: ListTagValuesRequest, runtime: $RuntimeOptions): ListTagValuesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTagValues',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries tag values.
 *
 * @param request ListTagValuesRequest
 * @return ListTagValuesResponse
 */
async function listTagValues(request: ListTagValuesRequest): ListTagValuesResponse {
  var runtime = new $RuntimeOptions{};
  return listTagValuesWithOptions(request, runtime);
}

model LoadBalancerJoinSecurityGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.

This parameter is required.', example='alb-h7kcw4g4nnvtqp****'),
  securityGroupIds?: [ string ](name='SecurityGroupIds', description='The security group IDs.

This parameter is required.'),
}

model LoadBalancerJoinSecurityGroupResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='8fe81f25-79a0-4fa0-9036-f2601fda****'),
  requestId?: string(name='RequestId', description='The request ID.', example='D3B9AE45-F5DB-58E3-A4B5-EE58F1EC****'),
}

model LoadBalancerJoinSecurityGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LoadBalancerJoinSecurityGroupResponseBody(name='body'),
}

/**
 * @summary Adds an Application Load Balancer (ALB) instance to a security group.
 *
 * @description *   By default, security groups are unavailable. To use security groups, contact your account manager.
 * *   Make sure that a security group is created. For more information about how to create security groups, see [CreateSecurityGroup](https://help.aliyun.com/document_detail/2679843.html).
 * *   Each ALB instance can be added to at most four security groups.
 * *   To query the security groups of an ALB instance, call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/2254835.html) operation.
 * *   GetLoadBalancerAttribute is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAsynJobs](https://help.aliyun.com/document_detail/2254893.html) operation to query the status of the task.
 *     *   If the task is in the Succeeded state, the ALB instance is added to the security group.
 *     *   If the task is in the Processing state, the ALB instance is being added to the security group. In this case, you can query the task but cannot perform other operations.
 *
 * @param request LoadBalancerJoinSecurityGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LoadBalancerJoinSecurityGroupResponse
 */
async function loadBalancerJoinSecurityGroupWithOptions(request: LoadBalancerJoinSecurityGroupRequest, runtime: $RuntimeOptions): LoadBalancerJoinSecurityGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.securityGroupIds)) {
    query['SecurityGroupIds'] = request.securityGroupIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'LoadBalancerJoinSecurityGroup',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds an Application Load Balancer (ALB) instance to a security group.
 *
 * @description *   By default, security groups are unavailable. To use security groups, contact your account manager.
 * *   Make sure that a security group is created. For more information about how to create security groups, see [CreateSecurityGroup](https://help.aliyun.com/document_detail/2679843.html).
 * *   Each ALB instance can be added to at most four security groups.
 * *   To query the security groups of an ALB instance, call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/2254835.html) operation.
 * *   GetLoadBalancerAttribute is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAsynJobs](https://help.aliyun.com/document_detail/2254893.html) operation to query the status of the task.
 *     *   If the task is in the Succeeded state, the ALB instance is added to the security group.
 *     *   If the task is in the Processing state, the ALB instance is being added to the security group. In this case, you can query the task but cannot perform other operations.
 *
 * @param request LoadBalancerJoinSecurityGroupRequest
 * @return LoadBalancerJoinSecurityGroupResponse
 */
async function loadBalancerJoinSecurityGroup(request: LoadBalancerJoinSecurityGroupRequest): LoadBalancerJoinSecurityGroupResponse {
  var runtime = new $RuntimeOptions{};
  return loadBalancerJoinSecurityGroupWithOptions(request, runtime);
}

model LoadBalancerLeaveSecurityGroupRequest {
  clientToken?: string(name='ClientToken', description='The task result.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0****'),
  dryRun?: boolean(name='DryRun', description='The client token that is used to ensure the idempotence of the request.
You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the ALB instance.

This parameter is required.', example='alb-iv9gj3lpak6fbj****'),
  securityGroupIds?: [ string ](name='SecurityGroupIds', description='The security IDs.

This parameter is required.'),
}

model LoadBalancerLeaveSecurityGroupResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='51c5b627-3500-487c-b17d-5cc583f0****'),
  requestId?: string(name='RequestId', description='The request ID.', example='EC0C96E4-7CCB-599C-9329-3A5DB6FF****'),
}

model LoadBalancerLeaveSecurityGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LoadBalancerLeaveSecurityGroupResponseBody(name='body'),
}

/**
 * @summary Removes an Application Load Balancer (ALB) instance from a security group.
 *
 * @description *   LoadBalancerLeaveSecurityGroup is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAsynJobs](https://help.aliyun.com/document_detail/2254893.html) operation to query the status of the task.
 *     *   If the task is in the Succeeded state, the ALB instance is removed from the security group.
 *     *   If the task is in the Processing state, the ALB instance is being removed from the security group. In this case, you can query the task but cannot perform other operations.
 *
 * @param request LoadBalancerLeaveSecurityGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LoadBalancerLeaveSecurityGroupResponse
 */
async function loadBalancerLeaveSecurityGroupWithOptions(request: LoadBalancerLeaveSecurityGroupRequest, runtime: $RuntimeOptions): LoadBalancerLeaveSecurityGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.securityGroupIds)) {
    query['SecurityGroupIds'] = request.securityGroupIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'LoadBalancerLeaveSecurityGroup',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes an Application Load Balancer (ALB) instance from a security group.
 *
 * @description *   LoadBalancerLeaveSecurityGroup is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAsynJobs](https://help.aliyun.com/document_detail/2254893.html) operation to query the status of the task.
 *     *   If the task is in the Succeeded state, the ALB instance is removed from the security group.
 *     *   If the task is in the Processing state, the ALB instance is being removed from the security group. In this case, you can query the task but cannot perform other operations.
 *
 * @param request LoadBalancerLeaveSecurityGroupRequest
 * @return LoadBalancerLeaveSecurityGroupResponse
 */
async function loadBalancerLeaveSecurityGroup(request: LoadBalancerLeaveSecurityGroupRequest): LoadBalancerLeaveSecurityGroupResponse {
  var runtime = new $RuntimeOptions{};
  return loadBalancerLeaveSecurityGroupWithOptions(request, runtime);
}

model MoveResourceGroupRequest {
  newResourceGroupId?: string(name='NewResourceGroupId', description='The ID of the resource group to which you want to transfer the cloud resource.

>  You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management for your Alibaba Cloud account. For more information, see [What is resource management?](https://help.aliyun.com/document_detail/94475.html)

This parameter is required.', example='rg-9gLOoK****'),
  resourceId?: string(name='ResourceId', description='The resource ID.

This parameter is required.', example='acl-hp34s2h0xx1ht4nwo****'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Valid values:

*   **loadbalancer**: Application Load Balancer (ALB) instance
*   **acl**: access control list (ACL)
*   **securitypolicy**: security policy
*   **servergroup**: server group

This parameter is required.', example='ACL'),
}

model MoveResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
}

model MoveResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MoveResourceGroupResponseBody(name='body'),
}

/**
 * @summary Moves a resource to another resource group.
 *
 * @param request MoveResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MoveResourceGroupResponse
 */
async function moveResourceGroupWithOptions(request: MoveResourceGroupRequest, runtime: $RuntimeOptions): MoveResourceGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.newResourceGroupId)) {
    query['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'MoveResourceGroup',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Moves a resource to another resource group.
 *
 * @param request MoveResourceGroupRequest
 * @return MoveResourceGroupResponse
 */
async function moveResourceGroup(request: MoveResourceGroupRequest): MoveResourceGroupResponse {
  var runtime = new $RuntimeOptions{};
  return moveResourceGroupWithOptions(request, runtime);
}

model RemoveEntriesFromAclRequest {
  aclId?: string(name='AclId', description='The ID of the ACL.

This parameter is required.', example='nacl-hp34s2h0xx1ht4nwo****'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  entries?: [ string ](name='Entries', description='The entries that you want to remove. You can remove up to 20 entries in each call.

This parameter is required.'),
}

model RemoveEntriesFromAclResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
}

model RemoveEntriesFromAclResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveEntriesFromAclResponseBody(name='body'),
}

/**
 * @summary Removes entries from an access control list (ACL).
 *
 * @description **RemoveEntriesFromAcl** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAclEntries](https://help.aliyun.com/document_detail/213616.html) operation to query the status of the task.
 * *   If an ACL is in the **Removing** state, the entries are being removed.
 * *   If an ACL cannot be found, the entries are removed.
 *
 * @param request RemoveEntriesFromAclRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveEntriesFromAclResponse
 */
async function removeEntriesFromAclWithOptions(request: RemoveEntriesFromAclRequest, runtime: $RuntimeOptions): RemoveEntriesFromAclResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.entries)) {
    query['Entries'] = request.entries;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveEntriesFromAcl',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes entries from an access control list (ACL).
 *
 * @description **RemoveEntriesFromAcl** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAclEntries](https://help.aliyun.com/document_detail/213616.html) operation to query the status of the task.
 * *   If an ACL is in the **Removing** state, the entries are being removed.
 * *   If an ACL cannot be found, the entries are removed.
 *
 * @param request RemoveEntriesFromAclRequest
 * @return RemoveEntriesFromAclResponse
 */
async function removeEntriesFromAcl(request: RemoveEntriesFromAclRequest): RemoveEntriesFromAclResponse {
  var runtime = new $RuntimeOptions{};
  return removeEntriesFromAclWithOptions(request, runtime);
}

model RemoveServersFromServerGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

This parameter is required.', example='sgp-atstuj3rtop****'),
  servers?: [ 
    {
      port?: int32(name='Port', description='The port that is used by the backend server. Valid values: **1** to **65535**.

>  This parameter is required when you set **ServerType** to **Ecs**, **Eni**, **Eci**, or **Ip**.', example='80'),
      serverId?: string(name='ServerId', description='The ID of the server group.

*   If the server group is of the **Instance** type, set ServerId to the ID of a resource of the **Ecs**, **Eni**, or **Eci** type.
*   If the server group is of the **Ip** type, set ServerId to IP addresses.
*   If the server group is of the **Fc**, set ServerId to the Alibaba Cloud Resource Name (ARN) of a function.

>  You can call the ListServerGroups operation to query information about the server group type so that you can set ServerId to a proper value.[](~~213627~~)

This parameter is required.', example='i-bp1f9kdprbgy9uiu****'),
      serverIp?: string(name='ServerIp', description='The IP address of the elastic network interface (ENI) in exclusive mode.', example='192.168.1.1'),
      serverType?: string(name='ServerType', description='The type of the backend server. Valid values:

*   **Ecs**: ECS instance
*   **Eni**: ENI
*   **Eci**: elastic container instance
*   **Ip**: IP address
*   **Fc**: Function Compute

This parameter is required.', example='Ecs'),
    }
  ](name='Servers', description='The server group. You can add at most 200 backend servers to the server group.

This parameter is required.'),
}

model RemoveServersFromServerGroupResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model RemoveServersFromServerGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveServersFromServerGroupResponseBody(name='body'),
}

/**
 * @summary Removes backend servers from a server group.
 *
 * @description **RemoveServersFromServerGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background.
 * 1.  You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the status of a server group.
 *     *   If a server group is in the **Configuring** state, it indicates that the server group is being modified.
 *     *   If a server group is in the **Available** state, it indicates that the server group is running.
 * 2.  You can call the [ListServerGroupServers](https://help.aliyun.com/document_detail/213628.html) operation to query the status of a backend server.
 *     *   If a backend server is in the **Removing** state, the server is being removed from the server group.
 *     *   If a backend server cannot be found, the server is no longer in the server group.
 *
 * @param request RemoveServersFromServerGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveServersFromServerGroupResponse
 */
async function removeServersFromServerGroupWithOptions(request: RemoveServersFromServerGroupRequest, runtime: $RuntimeOptions): RemoveServersFromServerGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.serverGroupId)) {
    query['ServerGroupId'] = request.serverGroupId;
  }
  if (!$isNull(request.servers)) {
    query['Servers'] = request.servers;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveServersFromServerGroup',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes backend servers from a server group.
 *
 * @description **RemoveServersFromServerGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background.
 * 1.  You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the status of a server group.
 *     *   If a server group is in the **Configuring** state, it indicates that the server group is being modified.
 *     *   If a server group is in the **Available** state, it indicates that the server group is running.
 * 2.  You can call the [ListServerGroupServers](https://help.aliyun.com/document_detail/213628.html) operation to query the status of a backend server.
 *     *   If a backend server is in the **Removing** state, the server is being removed from the server group.
 *     *   If a backend server cannot be found, the server is no longer in the server group.
 *
 * @param request RemoveServersFromServerGroupRequest
 * @return RemoveServersFromServerGroupResponse
 */
async function removeServersFromServerGroup(request: RemoveServersFromServerGroupRequest): RemoveServersFromServerGroupResponse {
  var runtime = new $RuntimeOptions{};
  return removeServersFromServerGroupWithOptions(request, runtime);
}

model ReplaceServersInServerGroupRequest {
  addedServers?: [ 
    {
      description?: string(name='Description', description='The description of the backend server. The description must be 2 to 256 characters in length, and cannot start with http:// or https://.', example='test'),
      port?: int32(name='Port', description='The port used by the backend server in the server group. Valid values: **1** to **65535**. You can specify at most 200 servers in each call.', example='80'),
      serverId?: string(name='ServerId', description='The ID of the backend server. You can specify at most 200 servers in each call.

*   If the server group is of the **Instance** type, set ServerId to the ID of a resource of the **Ecs**, **Eni**, or **Eci** type.
*   If the server group is of the **Ip** type, set ServerId to IP addresses.

>  You cannot perform this operation on a server group of the Function Compute type. You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the type of server groups.

This parameter is required.', example='i-bp1f9kdprbgy9uiu****'),
      serverIp?: string(name='ServerIp', description='The IP address of the elastic network interface (ENI) in exclusive mode.', example='192.168.1.1'),
      serverType?: string(name='ServerType', description='The type of backend server. You can specify at most 200 servers in each call. Valid values:

*   **Ecs**: Elastic Compute Service (ECS) instance
*   **Eni**: ENI
*   **Eci**: elastic container instance', example='Ecs'),
      weight?: int32(name='Weight', description='The weight of the backend server. You can specify at most 200 servers in each call.

Valid values: **0** to **100**. Default value: **100**. If the value is set to **0**, no requests are forwarded to the server.', example='100'),
    }
  ](name='AddedServers', description='The backend servers. You can specify at most 200 servers in each call.

This parameter is required.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx` HTTP status code is returned and the operation is performed.', example='true'),
  removedServers?: [ 
    {
      port?: int32(name='Port', description='The port that is used by the backend server. Valid values: **1** to **65535**. You can specify at most 200 servers in each call.', example='81'),
      serverId?: string(name='ServerId', description='The ID of the backend server. You can specify at most 200 servers in each call.

*   If the server group is of the **Instance** type, set ServerId to the ID of a resource of the **Ecs**, **Eni**, or **Eci** type.
*   If the server group is of the **Ip** type, set ServerId to IP addresses.

>  You cannot perform this operation on a server group of the Function Compute type. You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the type of server groups.

This parameter is required.', example='ecs-bp1ac9uozods2uc****'),
      serverIp?: string(name='ServerIp', description='The IP address of the ENI in exclusive mode.', example='192.168.1.12'),
      serverType?: string(name='ServerType', description='The type of backend server. You can specify at most 200 servers in each call. Valid values:

*   **Ecs**: ECS instance
*   **Eni**: ENI
*   **Eci**: elastic container instance', example='ecs'),
    }
  ](name='RemovedServers', description='The backend servers that you want to remove.

This parameter is required.'),
  serverGroupId?: string(name='ServerGroupId', description='The ID of the server group.

> You cannot perform this operation on a server group of the Function type.

This parameter is required.', example='sgp-5114d593o96qxy****'),
}

model ReplaceServersInServerGroupResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model ReplaceServersInServerGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReplaceServersInServerGroupResponseBody(name='body'),
}

/**
 * @summary Replaces backend servers in a server group.
 *
 * @description **ReplaceServersInServerGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background.
 * 1.  You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the status of a server group.
 *     *   If a server group is in the **Configuring** state, it indicates that the server group is being modified.
 *     *   If a server group is in the **Available** state, it indicates that the server group is running.
 * 2.  You can call the [ListServerGroupServers](https://help.aliyun.com/document_detail/213628.html) operation to query the status of a backend server.
 *     *   If a backend server is in the **Replacing** state, it indicates that the server is being removed from the server group and a new server is added to the server group.
 *     *   If a backend server is in the \\*\\*Available\\*\\* state, it indicates that the server is running.
 *
 * @param request ReplaceServersInServerGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReplaceServersInServerGroupResponse
 */
async function replaceServersInServerGroupWithOptions(request: ReplaceServersInServerGroupRequest, runtime: $RuntimeOptions): ReplaceServersInServerGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.addedServers)) {
    query['AddedServers'] = request.addedServers;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.removedServers)) {
    query['RemovedServers'] = request.removedServers;
  }
  if (!$isNull(request.serverGroupId)) {
    query['ServerGroupId'] = request.serverGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ReplaceServersInServerGroup',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Replaces backend servers in a server group.
 *
 * @description **ReplaceServersInServerGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background.
 * 1.  You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the status of a server group.
 *     *   If a server group is in the **Configuring** state, it indicates that the server group is being modified.
 *     *   If a server group is in the **Available** state, it indicates that the server group is running.
 * 2.  You can call the [ListServerGroupServers](https://help.aliyun.com/document_detail/213628.html) operation to query the status of a backend server.
 *     *   If a backend server is in the **Replacing** state, it indicates that the server is being removed from the server group and a new server is added to the server group.
 *     *   If a backend server is in the \\*\\*Available\\*\\* state, it indicates that the server is running.
 *
 * @param request ReplaceServersInServerGroupRequest
 * @return ReplaceServersInServerGroupResponse
 */
async function replaceServersInServerGroup(request: ReplaceServersInServerGroupRequest): ReplaceServersInServerGroupResponse {
  var runtime = new $RuntimeOptions{};
  return replaceServersInServerGroupWithOptions(request, runtime);
}

model StartListenerRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the **DryRunOperation** error code is returned.
*   **false**: (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='true'),
  listenerId?: string(name='ListenerId', description='The ID of the Application Load Balancer (ALB) listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
}

model StartListenerResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model StartListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartListenerResponseBody(name='body'),
}

/**
 * @summary Enables a listener.
 *
 * @description **StartListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [GetListenerAttribute](https://help.aliyun.com/document_detail/2254865.html) to query the status of the task.
 * *   If a listener is in the **Configuring** state, the listener is being enabled.
 * *   If a listener is in the **Running** state, the listener is enabled.
 *
 * @param request StartListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartListenerResponse
 */
async function startListenerWithOptions(request: StartListenerRequest, runtime: $RuntimeOptions): StartListenerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartListener',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables a listener.
 *
 * @description **StartListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [GetListenerAttribute](https://help.aliyun.com/document_detail/2254865.html) to query the status of the task.
 * *   If a listener is in the **Configuring** state, the listener is being enabled.
 * *   If a listener is in the **Running** state, the listener is enabled.
 *
 * @param request StartListenerRequest
 * @return StartListenerResponse
 */
async function startListener(request: StartListenerRequest): StartListenerResponse {
  var runtime = new $RuntimeOptions{};
  return startListenerWithOptions(request, runtime);
}

model StartShiftLoadBalancerZonesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='true'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.

This parameter is required.', example='alb-o9ulmq5hgn68jk****'),
  zoneMappings?: [ 
    {
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch in the zone. By default, each zone uses one vSwitch and one subnet.

This parameter is required.', example='vsw-bp1rmcrwg3erh1fh8****'),
      zoneId?: string(name='ZoneId', description='The zone ID. You can call the [DescribeZones](https://help.aliyun.com/document_detail/189196.html) operation to query the most recent zone list.

This parameter is required.', example='cn-hangzhou-a'),
    }
  ](name='ZoneMappings', description='The mappings between zones and vSwitches.

>  You can remove only one zone in each call.

This parameter is required.'),
}

model StartShiftLoadBalancerZonesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
}

model StartShiftLoadBalancerZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartShiftLoadBalancerZonesResponseBody(name='body'),
}

/**
 * @summary Removes an elastic IP address (EIP) or a virtual IP address (VIP) of a zone from a DNS record.
 *
 * @description This operation is supported by Application Load Balancer (ALB) instances that use static IP addresses. The zone cannot be removed if the ALB instance has only one available zone.
 *
 * @param request StartShiftLoadBalancerZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartShiftLoadBalancerZonesResponse
 */
async function startShiftLoadBalancerZonesWithOptions(request: StartShiftLoadBalancerZonesRequest, runtime: $RuntimeOptions): StartShiftLoadBalancerZonesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.zoneMappings)) {
    query['ZoneMappings'] = request.zoneMappings;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartShiftLoadBalancerZones',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes an elastic IP address (EIP) or a virtual IP address (VIP) of a zone from a DNS record.
 *
 * @description This operation is supported by Application Load Balancer (ALB) instances that use static IP addresses. The zone cannot be removed if the ALB instance has only one available zone.
 *
 * @param request StartShiftLoadBalancerZonesRequest
 * @return StartShiftLoadBalancerZonesResponse
 */
async function startShiftLoadBalancerZones(request: StartShiftLoadBalancerZonesRequest): StartShiftLoadBalancerZonesResponse {
  var runtime = new $RuntimeOptions{};
  return startShiftLoadBalancerZonesWithOptions(request, runtime);
}

model StopListenerRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='true'),
  listenerId?: string(name='ListenerId', description='The ID of the Application Load Balancer (ALB) listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
}

model StopListenerResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model StopListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopListenerResponseBody(name='body'),
}

/**
 * @summary Disables a listener.
 *
 * @description **StopListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetListenerAttribute](https://help.aliyun.com/document_detail/2254865.html) operation to query the status of the task:
 * *   If a listener is in the **Configuring** state, the listener is being disabled.
 * *   If a listener is in the **Stopped** state, the listener is disabled.
 *
 * @param request StopListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopListenerResponse
 */
async function stopListenerWithOptions(request: StopListenerRequest, runtime: $RuntimeOptions): StopListenerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StopListener',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disables a listener.
 *
 * @description **StopListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetListenerAttribute](https://help.aliyun.com/document_detail/2254865.html) operation to query the status of the task:
 * *   If a listener is in the **Configuring** state, the listener is being disabled.
 * *   If a listener is in the **Stopped** state, the listener is disabled.
 *
 * @param request StopListenerRequest
 * @return StopListenerResponse
 */
async function stopListener(request: StopListenerRequest): StopListenerResponse {
  var runtime = new $RuntimeOptions{};
  return stopListenerWithOptions(request, runtime);
}

model TagResourcesRequest {
  resourceId?: [ string ](name='ResourceId', description='The resource IDs.

This parameter is required.', example='acl-123'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Valid values:

*   **acl**: an access control list (ACL)
*   **loadbalancer**: an Application Load Balancer (ALB) instance
*   **securitypolicy**: a security policy
*   **servergroup**: a server group

This parameter is required.', example='loadbalancer'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The tag value. The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tag', description='The tags.

This parameter is required.', example='test'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary Adds tags to resources.
 *
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: $RuntimeOptions): TagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'TagResources',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds tags to resources.
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UnTagResourcesRequest {
  all?: boolean(name='All', description='Specifies whether to remove all tags from the specified resource. Valid values:

*   **true**
*   **false**', example='false'),
  resourceId?: [ string ](name='ResourceId', description='The IDs of the resources from which you want to remove tags.

This parameter is required.', example='acl-123'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Valid values:

*   **acl**: an access control list (ACL)
*   **loadbalancer**: an Application Load Balancer (ALB) instance
*   **securitypolicy**: a security policy
*   **servergroup**: a server group

This parameter is required.', example='loadbalancer'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag that you want to remove. The tag key can be up to 128 characters in length, and cannot contain `http://` or `https://`. The tag key cannot start with `acs:` or `aliyun`.', example='env'),
      value?: string(name='Value', description='The value of the tag that you want to remove. The tag value can be up to 128 characters in length, and cannot contain `http://` or `https://`. The tag value cannot start with `acs:` or `aliyun`.', example='product'),
    }
  ](name='Tag', description='The tags that you want to remove.', example='test'),
  tagKey?: [ string ](name='TagKey', description='The keys of the tags that you want to remove.'),
}

model UnTagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
}

model UnTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnTagResourcesResponseBody(name='body'),
}

/**
 * @summary Removes tags from resources.
 *
 * @param request UnTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnTagResourcesResponse
 */
async function unTagResourcesWithOptions(request: UnTagResourcesRequest, runtime: $RuntimeOptions): UnTagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.all)) {
    query['All'] = request.all;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UnTagResources',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes tags from resources.
 *
 * @param request UnTagResourcesRequest
 * @return UnTagResourcesResponse
 */
async function unTagResources(request: UnTagResourcesRequest): UnTagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return unTagResourcesWithOptions(request, runtime);
}

model UpdateAScriptsRequest {
  AScripts?: [ 
    {
      AScriptId?: string(name='AScriptId', description='The rule ID.

This parameter is required.', example='as-mhqxcanmivn4g5****'),
      AScriptName?: string(name='AScriptName', description='The name of the AScript rule.

The name must be 2 to 128 character in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.', example='Group1'),
      enabled?: boolean(name='Enabled', description='Specifies whether to enable the AScript rule. Valid values:

*   **true**
*   **false** (default)', example='true'),
      extAttributeEnabled?: boolean(name='ExtAttributeEnabled', description='Specifies whether to enable the extended attributes of the Ascript rule. Valid values:

*   true
*   false (false)', example='true'),
      extAttributes?: [ 
        {
          attributeKey?: string(name='AttributeKey', description='The attribute name.

Set the value to **EsDebug**, which specifies that when requests carry the _es_dbg parameter whose value is the specified key, the debugging header is enabled to output the execution result.

This parameter is required.', example='EsDebug'),
          attributeValue?: string(name='AttributeValue', description='The attribute value, which must be 1 to 128 characters in length, and can contain letters and digits.

This parameter is required.', example='test123'),
        }
      ](name='ExtAttributes', description='The extended attribute.'),
      scriptContent?: string(name='ScriptContent', description='The content of the AScript rule.', example='if and(match_re($uri, \\\\"^/1.txt$\\\\"), $arg_type) { rewrite(concat(\\\\"/1.\\\\", $arg_type), \\\\"break\\\\") }'),
    }
  ](name='AScripts', description='The information about the AScript rule.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='b1f642ac-5558-4a36-b7d9-cf53f40ea5c8'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**(default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
}

model UpdateAScriptsResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='2e82b5f4-1ba9-4d20-89c8-1082ebaa****'),
  requestId?: string(name='RequestId', description='The request ID.', example='ACA19FE1-C09E-53C7-8FDA-560F49D71891'),
}

model UpdateAScriptsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAScriptsResponseBody(name='body'),
}

/**
 * @summary Updates AScript rules.
 *
 * @description **UpdateAScripts** is an an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAScripts](https://help.aliyun.com/document_detail/472574.html) operation to query the status of an AScript rule.
 * *   If the rule is in the **Configuring** state, the rule is being updated.
 * *   If the rule is in the **Available** state, the rule is updated.
 *
 * @param request UpdateAScriptsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAScriptsResponse
 */
async function updateAScriptsWithOptions(request: UpdateAScriptsRequest, runtime: $RuntimeOptions): UpdateAScriptsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.AScripts)) {
    query['AScripts'] = request.AScripts;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateAScripts',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates AScript rules.
 *
 * @description **UpdateAScripts** is an an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListAScripts](https://help.aliyun.com/document_detail/472574.html) operation to query the status of an AScript rule.
 * *   If the rule is in the **Configuring** state, the rule is being updated.
 * *   If the rule is in the **Available** state, the rule is updated.
 *
 * @param request UpdateAScriptsRequest
 * @return UpdateAScriptsResponse
 */
async function updateAScripts(request: UpdateAScriptsRequest): UpdateAScriptsResponse {
  var runtime = new $RuntimeOptions{};
  return updateAScriptsWithOptions(request, runtime);
}

model UpdateAclAttributeRequest {
  aclId?: string(name='AclId', description='The ACL ID.

This parameter is required.', example='nacl-hp34s2h0xx1ht4nwo****'),
  aclName?: string(name='AclName', description='The ACL name. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.

This parameter is required.', example='test-acl'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

> If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx` HTTP status code is returned and the operation is performed.', example='true'),
}

model UpdateAclAttributeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model UpdateAclAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAclAttributeResponseBody(name='body'),
}

/**
 * @summary Updates the attributes of an access control list (ACL), such as the name.
 *
 * @param request UpdateAclAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAclAttributeResponse
 */
async function updateAclAttributeWithOptions(request: UpdateAclAttributeRequest, runtime: $RuntimeOptions): UpdateAclAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!$isNull(request.aclName)) {
    query['AclName'] = request.aclName;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateAclAttribute',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the attributes of an access control list (ACL), such as the name.
 *
 * @param request UpdateAclAttributeRequest
 * @return UpdateAclAttributeResponse
 */
async function updateAclAttribute(request: UpdateAclAttributeRequest): UpdateAclAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateAclAttributeWithOptions(request, runtime);
}

model UpdateHealthCheckTemplateAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a **2xx** HTTP status code is returned and the operation is performed.', example='true'),
  healthCheckCodes?: [ string ](name='HealthCheckCodes', description='The HTTP status codes that indicate a healthy backend server.', example='5'),
  healthCheckConnectPort?: int32(name='HealthCheckConnectPort', description='The port that is used for health checks. Valid values: **0 to 65535**. Default value: **0**. This value indicates that the port of a backend server is used for health checks.', example='80'),
  healthCheckHost?: string(name='HealthCheckHost', description='The domain name that is used for health checks. Valid values:

*   **$SERVER_IP** (default): the private IP address of a backend server. If an IP address is specified, or this parameter is not specified, the ALB instance uses the private IP addresses of backend servers as domain names for health checks.
*   **domain**: The domain name must be 1 to 80 characters in length, and can contain letters, digits, periods (.), and hyphens (-).

>  This parameter is available only if `HealthCheckProtocol` is set to **HTTP** or **HTTPS**.', example='$_ip'),
  healthCheckHttpVersion?: string(name='HealthCheckHttpVersion', description='The HTTP version that is used for health checks.

Valid values: **HTTP1.0** and **HTTP1.1**.

Default value: **HTTP1.1**.

>  This parameter is available only if you set `HealthCheckProtocol` to **HTTP** or **HTTPS**.', example='HTTP1.0'),
  healthCheckInterval?: int32(name='HealthCheckInterval', description='The interval at which health checks are performed. Unit: seconds. Valid values: **1 to 50**. Default value: **2**.', example='5'),
  healthCheckMethod?: string(name='HealthCheckMethod', description='The HTTP method that is used for health checks. Valid values:

*   **HEAD** (default): By default, HTTP and HTTPS health checks use the HEAD method.
*   **GET**: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.
*   **POST**: gRPC health checks use the POST method by default.

>  This parameter is available only if you set **HealthCheckProtocol** to **HTTP**, **HTTPS**, or **gRPC**.', example='HEAD'),
  healthCheckPath?: string(name='HealthCheckPath', description='The URL that is used for health checks.

The URL must be 1 to 80 characters in length and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), ampersands (&), and the following extended character sets: `_ ; ~ ! ( ) * [ ] @ $ ^ : \\\\" , +`.

The URL must start with a forward slash (/).

>  This parameter is available only if you set **HealthCheckProtocol** to **HTTP**, **HTTPS**, or **gRPC**.', example='/test/index.html'),
  healthCheckProtocol?: string(name='HealthCheckProtocol', description='The protocol that is used for health checks. Valid values:

*   **HTTP** (default): HTTP health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers.
*   **HTTPS**: The ALB instance sends HEAD or GET requests, which simulate browser requests, to check whether the backend server is healthy. HTTPS supports encryption and provides higher security than HTTP.
*   **TCP**: TCP health checks send TCP SYN packets to a backend server to check whether the port of the backend server is reachable.
*   **gRPC**: gRPC health checks send POST or GET requests to a backend server to check whether the backend server is healthy.', example='HTTP'),
  healthCheckTemplateId?: string(name='HealthCheckTemplateId', description='The template ID.

This parameter is required.', example='hct-bp1qjwo61pqz3ahltv0mw'),
  healthCheckTemplateName?: string(name='HealthCheckTemplateName', description='The name of the health check template.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='HealthCheckTemplate1'),
  healthCheckTimeout?: int32(name='HealthCheckTimeout', description='The timeout period of a health check response. If a backend server does not respond within the specified timeout period, the backend server is declared unhealthy.

Unit: seconds. Valid values: **1 to 300**. Default value: **5**.', example='3'),
  healthyThreshold?: int32(name='HealthyThreshold', description='The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status is changed from **fail** to **success**.

Valid values: **2 to 10**.

Default value: **3**.', example='4'),
  unhealthyThreshold?: int32(name='UnhealthyThreshold', description='The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status is changed from **success** to **fail**.

Valid values: **2 to 10**.

Default value: **3**.', example='4'),
}

model UpdateHealthCheckTemplateAttributeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model UpdateHealthCheckTemplateAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateHealthCheckTemplateAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the attributes, such as the name and protocol, of a health check template.
 *
 * @param request UpdateHealthCheckTemplateAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateHealthCheckTemplateAttributeResponse
 */
async function updateHealthCheckTemplateAttributeWithOptions(request: UpdateHealthCheckTemplateAttributeRequest, runtime: $RuntimeOptions): UpdateHealthCheckTemplateAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.healthCheckCodes)) {
    query['HealthCheckCodes'] = request.healthCheckCodes;
  }
  if (!$isNull(request.healthCheckConnectPort)) {
    query['HealthCheckConnectPort'] = request.healthCheckConnectPort;
  }
  if (!$isNull(request.healthCheckHost)) {
    query['HealthCheckHost'] = request.healthCheckHost;
  }
  if (!$isNull(request.healthCheckHttpVersion)) {
    query['HealthCheckHttpVersion'] = request.healthCheckHttpVersion;
  }
  if (!$isNull(request.healthCheckInterval)) {
    query['HealthCheckInterval'] = request.healthCheckInterval;
  }
  if (!$isNull(request.healthCheckMethod)) {
    query['HealthCheckMethod'] = request.healthCheckMethod;
  }
  if (!$isNull(request.healthCheckPath)) {
    query['HealthCheckPath'] = request.healthCheckPath;
  }
  if (!$isNull(request.healthCheckProtocol)) {
    query['HealthCheckProtocol'] = request.healthCheckProtocol;
  }
  if (!$isNull(request.healthCheckTemplateId)) {
    query['HealthCheckTemplateId'] = request.healthCheckTemplateId;
  }
  if (!$isNull(request.healthCheckTemplateName)) {
    query['HealthCheckTemplateName'] = request.healthCheckTemplateName;
  }
  if (!$isNull(request.healthCheckTimeout)) {
    query['HealthCheckTimeout'] = request.healthCheckTimeout;
  }
  if (!$isNull(request.healthyThreshold)) {
    query['HealthyThreshold'] = request.healthyThreshold;
  }
  if (!$isNull(request.unhealthyThreshold)) {
    query['UnhealthyThreshold'] = request.unhealthyThreshold;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateHealthCheckTemplateAttribute',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the attributes, such as the name and protocol, of a health check template.
 *
 * @param request UpdateHealthCheckTemplateAttributeRequest
 * @return UpdateHealthCheckTemplateAttributeResponse
 */
async function updateHealthCheckTemplateAttribute(request: UpdateHealthCheckTemplateAttributeRequest): UpdateHealthCheckTemplateAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateHealthCheckTemplateAttributeWithOptions(request, runtime);
}

model UpdateListenerAttributeRequest {
  caCertificates?: [ 
    {
      certificateId?: string(name='CertificateId', description='The ID of the CA certificate.

>  This parameter is required if **CaEnabled** is set to **true**.', example='123359******'),
    }
  ](name='CaCertificates', description='The CA certificate. You can specify only one CA certificate.'),
  caEnabled?: boolean(name='CaEnabled', description='Specifies whether to enable mutual authentication. Valid values:

*   **true**
*   **false**', example='false'),
  certificates?: [ 
    {
      certificateId?: string(name='CertificateId', description='The certificate ID.', example='12315790212_166f8204689_1714763408_70998****'),
    }
  ](name='Certificates', description='The certificates. You can add at most 20 certificates.

>  Only server certificates are supported.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  defaultActions?: [ 
    {
      forwardGroupConfig?: {
        serverGroupTuples?: [ 
          {
            serverGroupId?: string(name='ServerGroupId', description='The ID of the server group to which requests are forwarded.

This parameter is required.', example='rsp-cige6j5e7p****'),
          }
        ](name='ServerGroupTuples', description='The server groups to which requests are forwarded.

This parameter is required.'),
      }(name='ForwardGroupConfig', description='The forwarding action. This parameter takes effect only when you set **Type** to **ForwardGroup**. You can specify at most 20 actions.'),
      type?: string(name='Type', description='The action type. You can specify only one type.

Set the value to **ForwardGroup**, which specifies that requests are forwarded to multiple server groups.

This parameter is required.', example='ForwardGroup'),
    }
  ](name='DefaultActions', description='The actions of the default forwarding rule.'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='false'),
  gzipEnabled?: boolean(name='GzipEnabled', description='Specifies whether to enable GZIP compression for specific types of files. Valid values:

*   **true**
*   **false**', example='true'),
  http2Enabled?: boolean(name='Http2Enabled', description='Specifies whether to enable HTTP/2. Valid values:

*   **true**
*   **false**

> This parameter is available only when you create an HTTPS listener.', example='true'),
  idleTimeout?: int32(name='IdleTimeout', description='The timeout period of an idle connection. Unit: seconds. Valid values: **1 to 60**.

If no request is received within the specified timeout period, ALB closes the current connection. When another request is received, ALB establishes a new connection.', example='15'),
  listenerDescription?: string(name='ListenerDescription', description='The name of the listener.

The name must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).', example='HTTP_80'),
  listenerId?: string(name='ListenerId', description='The ID of the Application Load Balancer (ALB) instance.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
  quicConfig?: {
    quicListenerId?: string(name='QuicListenerId', description='The QUIC listener ID. This parameter is required if **QuicUpgradeEnabled** is set to **true**. Only HTTPS listeners support this parameter.

> You must add the HTTPS listener and the QUIC listener to the same ALB instance. In addition, make sure that the QUIC listener has never been associated with another listener.', example='lsn-333'),
    quicUpgradeEnabled?: boolean(name='QuicUpgradeEnabled', description='Specifies whether to enable QUIC upgrade. Valid values:

*   **true**
*   **false**

> Only HTTPS listeners support this parameter.', example='false'),
  }(name='QuicConfig', description='The configuration information when the listener is associated with a QUIC listener.'),
  requestTimeout?: int32(name='RequestTimeout', description='The timeout period of a request. Unit: seconds. Valid values: **1 to 180**.

If no response is received from the backend server within the specified timeout period, ALB returns an `HTTP 504` error code to the client.', example='3'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The security policy ID. System security policies and custom security policies are supported.

> This parameter is available only when you create an HTTPS listener.', example='tls_cipher_policy_1_0'),
  XForwardedForConfig?: {
    XForwardedForClientCertClientVerifyAlias?: string(name='XForwardedForClientCertClientVerifyAlias', description='The name of the custom header. The header takes effect only when you set **XForwardedForClientCertClientVerifyEnabled **to **true**.

The name must be 1 to 40 characters in length. It can contain lowercase letters, digits, hyphens (-), and underscores (_).

>  This parameter is only available for HTTPS listeners.', example='test_client-verify-alias_123456'),
    XForwardedForClientCertClientVerifyEnabled?: boolean(name='XForwardedForClientCertClientVerifyEnabled', description='Specifies whether to use the `X-Forwarded-Clientcert-clientverify` header to retrieve the verification result of the client certificate. Valid values:

*   **true**
*   **false**

>  This parameter is only available for HTTPS listeners.', example='false'),
    XForwardedForClientCertFingerprintAlias?: string(name='XForwardedForClientCertFingerprintAlias', description='The name of the custom header. The header takes effect only when you set **XForwardedForClientCertFingerprintEnabled** to **true**.

The name must be 1 to 40 characters in length. It can contain lowercase letters, digits, hyphens (-), and underscores (_).

>  This parameter is only available for HTTPS listeners.', example='test_finger-print-alias_123456'),
    XForwardedForClientCertFingerprintEnabled?: boolean(name='XForwardedForClientCertFingerprintEnabled', description='Specifies whether to use the `X-Forwarded-Clientcert-fingerprint` header to retrieve the fingerprint of the client certificate. Valid values:

*   **true**
*   **false**

>  This parameter is only available for HTTPS listeners.', example='false'),
    XForwardedForClientCertIssuerDNAlias?: string(name='XForwardedForClientCertIssuerDNAlias', description='The name of the custom header. The header takes effect only when you set **XForwardedForClientCertIssuerDNEnabled** to **true**.

The name must be 1 to 40 characters in length. It can contain lowercase letters, digits, hyphens (-), and underscores (_).

>  This parameter is only available for HTTPS listeners.', example='test_issue-dn-alias_123456'),
    XForwardedForClientCertIssuerDNEnabled?: boolean(name='XForwardedForClientCertIssuerDNEnabled', description='Specifies whether to use the `X-Forwarded-Clientcert-issuerdn` header to retrieve information about the authority that issues the client certificate. Valid values:

*   **true**
*   **false**

>  This parameter is only available for HTTPS listeners.', example='false'),
    XForwardedForClientCertSubjectDNAlias?: string(name='XForwardedForClientCertSubjectDNAlias', description='The name of the custom header. This parameter is valid only if the **XForwardedForClientCertSubjectDNEnabled** parameter is set to **true**.

The name must be 1 to 40 characters in length. It can contain lowercase letters, digits, hyphens (-), and underscores (_).

>  This parameter is only available for HTTPS listeners.', example='test_subject-dn-alias_123456'),
    XForwardedForClientCertSubjectDNEnabled?: boolean(name='XForwardedForClientCertSubjectDNEnabled', description='Specifies whether to use the `X-Forwarded-Clientcert-subjectdn` header to retrieve information about the owner of the client certificate. Valid values:

*   **true**
*   **false**

>  This parameter is only available for HTTPS listeners.', example='false'),
    XForwardedForClientSourceIpsEnabled?: boolean(name='XForwardedForClientSourceIpsEnabled', description='Specifies whether to use the X-Forwarded-For header to preserve client IP addresses. Valid values:

*   **true**
*   **false**

>  This parameter is only available for HTTP and HTTPS listeners.', example='false'),
    XForwardedForClientSourceIpsTrusted?: string(name='XForwardedForClientSourceIpsTrusted', description='The trusted proxy IP address.

ALB instances traverse the IP addresses in the `X-Forwarded-For` header from the rightmost IP address to the leftmost IP address. The first IP address that is not on the trusted IP address list is considered the client IP address. Requests from the client IP address are throttled.', example='10.1.1.0/24'),
    XForwardedForClientSrcPortEnabled?: boolean(name='XForwardedForClientSrcPortEnabled', description='Specifies whether to use the `X-Forwarded-Client-srcport` header to retrieve the client port. Valid values:

*   **true**
*   **false**

>  This parameter is only available for HTTP and HTTPS listeners.', example='false'),
    XForwardedForEnabled?: boolean(name='XForwardedForEnabled', description='Specifies whether to use the `X-Forwarded-For` header to retrieve the client IP address. Valid values:

*   **true** (default)
*   **false**

> *   If this parameter is set to **true**, the default value of the **XForwardedForProcessingMode** parameter is **append**. You can change it to **remove**.
> *   If this parameter is set to **false**, the `X-Forwarded-For` header in the request is not modified in any way before the request is sent to backend servers.
> *   This parameter is only available for HTTP and HTTPS listeners.', example='true'),
    XForwardedForHostEnabled?: boolean(name='XForwardedForHostEnabled', description='Specifies whether to use the `X-Forwarded-Host` header to retrieve the client domain name. Valid values:

*   **true**
*   **false** (default)

>  This parameter is available for HTTP, HTTPS, and QUIC listeners.', example='false'),
    XForwardedForProcessingMode?: string(name='XForwardedForProcessingMode', description='Specifies how the `X-Forwarded-For` header is processed. This parameter takes effect only when **XForwardedForEnabled** is set to **true**. Valid values:

*   **append** (default)
*   **remove**

> *   If this parameter is set to **append**, ALB appends the IP address of the last hop to the existing `X-Forwarded-For` header in the request before the request is sent to backend servers.
> *   If this parameter is set to **remove**, ALB removes the `X-Forwarded-For` header in the request before the request is sent to backend servers, no matter whether the request carries the `X-Forwarded-For` header.
> *   This parameter is only available for HTTP and HTTPS listeners.', example='append'),
    XForwardedForProtoEnabled?: boolean(name='XForwardedForProtoEnabled', description='Specifies whether to use the `X-Forwarded-Proto` header to retrieve the listener protocol. Valid values:

*   **true**
*   **false**

>  This parameter is available for HTTP, HTTPS, and QUIC listeners.', example='false'),
    XForwardedForSLBIdEnabled?: boolean(name='XForwardedForSLBIdEnabled', description='Specifies whether to use the `SLB-ID` header to retrieve the ID of the ALB instance. Valid values:

*   **true**
*   **false**

>  This parameter is available for HTTP, HTTPS, and QUIC listeners.', example='false'),
    XForwardedForSLBPortEnabled?: boolean(name='XForwardedForSLBPortEnabled', description='Specifies whether to use the `X-Forwarded-Port` header to retrieve the listener port of the ALB instance. Valid values:

*   **true**
*   **false**

>  This parameter is available for HTTP, HTTPS, and QUIC listeners.', example='false'),
  }(name='XForwardedForConfig', description='The configurations of the X-Forwarded-For header.'),
}

model UpdateListenerAttributeResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model UpdateListenerAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateListenerAttributeResponseBody(name='body'),
}

/**
 * @summary Updates the attributes of a listener, such as the name and the default action.
 *
 * @description **UpdateListenerAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetListenerAttribute](https://help.aliyun.com/document_detail/2254865.html) operation to query the status of the task.
 * *   If a listener is in the **Configuring** state, the configuration of the listener is being modified.
 * *   If a listener is in the **Running** state, the configuration of the listener is modified.
 *
 * @param request UpdateListenerAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateListenerAttributeResponse
 */
async function updateListenerAttributeWithOptions(request: UpdateListenerAttributeRequest, runtime: $RuntimeOptions): UpdateListenerAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.caCertificates)) {
    query['CaCertificates'] = request.caCertificates;
  }
  if (!$isNull(request.caEnabled)) {
    query['CaEnabled'] = request.caEnabled;
  }
  if (!$isNull(request.certificates)) {
    query['Certificates'] = request.certificates;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.defaultActions)) {
    query['DefaultActions'] = request.defaultActions;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.gzipEnabled)) {
    query['GzipEnabled'] = request.gzipEnabled;
  }
  if (!$isNull(request.http2Enabled)) {
    query['Http2Enabled'] = request.http2Enabled;
  }
  if (!$isNull(request.idleTimeout)) {
    query['IdleTimeout'] = request.idleTimeout;
  }
  if (!$isNull(request.listenerDescription)) {
    query['ListenerDescription'] = request.listenerDescription;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!$isNull(request.quicConfig)) {
    query['QuicConfig'] = request.quicConfig;
  }
  if (!$isNull(request.requestTimeout)) {
    query['RequestTimeout'] = request.requestTimeout;
  }
  if (!$isNull(request.securityPolicyId)) {
    query['SecurityPolicyId'] = request.securityPolicyId;
  }
  if (!$isNull(request.XForwardedForConfig)) {
    query['XForwardedForConfig'] = request.XForwardedForConfig;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateListenerAttribute',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the attributes of a listener, such as the name and the default action.
 *
 * @description **UpdateListenerAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetListenerAttribute](https://help.aliyun.com/document_detail/2254865.html) operation to query the status of the task.
 * *   If a listener is in the **Configuring** state, the configuration of the listener is being modified.
 * *   If a listener is in the **Running** state, the configuration of the listener is modified.
 *
 * @param request UpdateListenerAttributeRequest
 * @return UpdateListenerAttributeResponse
 */
async function updateListenerAttribute(request: UpdateListenerAttributeRequest): UpdateListenerAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateListenerAttributeWithOptions(request, runtime);
}

model UpdateListenerLogConfigRequest {
  accessLogRecordCustomizedHeadersEnabled?: boolean(name='AccessLogRecordCustomizedHeadersEnabled', description='Specifies whether to record custom headers in the access log. Valid values:

*   **true**
*   **false** (default)

> You can set this parameter to **true** only if the access log feature is enabled by specifying **AccessLogEnabled**.', example='true'),
  accessLogTracingConfig?: {
    tracingEnabled?: boolean(name='TracingEnabled', description='Specifies whether to enable the Xtrace feature. Valid values:

*   **true**
*   **false** (default)

> You can set this parameter to **true** only if the access log feature is enabled by specifying **AccessLogEnabled**.

This parameter is required.', example='true'),
    tracingSample?: int32(name='TracingSample', description='The sampling rate of the Xtrace feature.

Valid values: **1 to 10000**.

> This parameter takes effect only if you set **TracingEnabled** to **true**.', example='100'),
    tracingType?: string(name='TracingType', description='The type of Xtrace. Set the value to **Zipkin**.

> This parameter takes effect only if you set **TracingEnabled** to **true**.', example='Zipkin'),
  }(name='AccessLogTracingConfig', description='The configuration information about the Xtrace feature.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**: (default): performs a dry run and performs the actual request. If the request passes the dry run, a **2xx HTTP** status code is returned and the operation is performed.', example='true'),
  listenerId?: string(name='ListenerId', description='The ID of the Application Load Balancer (ALB) listener.

This parameter is required.', example='lsr-bp1bpn0kn908w4nbw****'),
}

model UpdateListenerLogConfigResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model UpdateListenerLogConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateListenerLogConfigResponseBody(name='body'),
}

/**
 * @summary Updates the log configuration of a listener, such as the access log configuration.
 *
 * @description **UpdateListenerLogConfig** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [GetListenerAttribute](https://help.aliyun.com/document_detail/2254865.html) to query the status of the task:
 * *   If a listener is in the **Configuring** state, the log configuration of the listener is being modified.
 * *   If a listener is in the **Running** state, the log configuration of the listener is modified.
 * > You can update the log configuration of a listener only after you enable the access log feature.
 *
 * @param request UpdateListenerLogConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateListenerLogConfigResponse
 */
async function updateListenerLogConfigWithOptions(request: UpdateListenerLogConfigRequest, runtime: $RuntimeOptions): UpdateListenerLogConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accessLogRecordCustomizedHeadersEnabled)) {
    query['AccessLogRecordCustomizedHeadersEnabled'] = request.accessLogRecordCustomizedHeadersEnabled;
  }
  if (!$isNull(request.accessLogTracingConfig)) {
    query['AccessLogTracingConfig'] = request.accessLogTracingConfig;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateListenerLogConfig',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the log configuration of a listener, such as the access log configuration.
 *
 * @description **UpdateListenerLogConfig** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [GetListenerAttribute](https://help.aliyun.com/document_detail/2254865.html) to query the status of the task:
 * *   If a listener is in the **Configuring** state, the log configuration of the listener is being modified.
 * *   If a listener is in the **Running** state, the log configuration of the listener is modified.
 * > You can update the log configuration of a listener only after you enable the access log feature.
 *
 * @param request UpdateListenerLogConfigRequest
 * @return UpdateListenerLogConfigResponse
 */
async function updateListenerLogConfig(request: UpdateListenerLogConfigRequest): UpdateListenerLogConfigResponse {
  var runtime = new $RuntimeOptions{};
  return updateListenerLogConfigWithOptions(request, runtime);
}

model UpdateLoadBalancerAddressTypeConfigRequest {
  addressType?: string(name='AddressType', description='The new network type. Valid values:

*   **Internet**: The ALB instance uses a public IP address. The domain name of the ALB instance is resolved to the public IP address. Therefore, the ALB instance can be accessed over the Internet.
*   **Intranet**: The ALB instance uses a private IP address. The domain name of the ALB instance is resolved to the private IP address. In this case, the ALB instance can be accessed over the virtual private cloud (VPC) where the ALB instance is deployed.

This parameter is required.', example='Internet'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-42665544****'),
  dryRun?: string(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ALB instance ID.

This parameter is required.', example='lb-bp1o94dp5i6ea****'),
  zoneMappings?: [ 
    {
      allocationId?: string(name='AllocationId', description='The ID of the elastic IP address (EIP). You can specify a maximum of 10 zones.

>  This parameter is required if you want to change the network type from internal-facing to Internet-facing.', example='eip-bp1aedxso6u80u0qf****'),
      eipType?: string(name='EipType', description='The type of EIP. Valid values:

*   **Common**: an EIP.
*   **Anycast**: an Anycast EIP.

>  For more information about the regions in which ALB supports Anycast EIPs, see [Limits](https://help.aliyun.com/document_detail/460727.html).', example='Common'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch in the zone. You can specify only one vSwitch (subnet) in each zone of an ALB instance. You can specify a maximum of 10 zones. If the selected region supports two or more zones, select at least two zones to ensure the high availability of your service.', example='vsw-bp10ttov87felojcn****'),
      zoneId?: string(name='ZoneId', description='The zone ID of the ALB instance. You can specify a maximum of 10 zones. If the selected region supports two or more zones, select at least two zones to ensure the high availability of your service.

You can call the [DescribeZones](https://help.aliyun.com/document_detail/189196.html) operation to query the information about the zone.', example='cn-hangzhou-a'),
    }
  ](name='ZoneMappings', description='The zones and the vSwitches in the zones. You can specify a maximum of 10 zones. If the selected region supports two or more zones, select at least two zones to ensure the high availability of your service.'),
}

model UpdateLoadBalancerAddressTypeConfigResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous job.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
}

model UpdateLoadBalancerAddressTypeConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLoadBalancerAddressTypeConfigResponseBody(name='body'),
}

/**
 * @summary Modifies the network type of an Application Load Balancer (ALB) instance.
 *
 * @description ## Prerequisites
 * *   An ALB instance is created. For more information about how to create an ALB instance, see [CreateLoadBalancer](https://help.aliyun.com/document_detail/214358.html).
 * *   If you want to change the network type from internal-facing to Internet-facing, you must first create an elastic IP address (EIP). For more information, see [AllocateEipAddress](https://help.aliyun.com/document_detail/120192.html).
 * ## Usage notes
 * **UpdateLoadBalancerAddressTypeConfig** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the status of the task.
 * *   If an ALB instance is in the **Configuring** state, the network type is being changed.
 * *   If an ALB instance is in the **Active** state, the network type has been changed.
 *
 * @param request UpdateLoadBalancerAddressTypeConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLoadBalancerAddressTypeConfigResponse
 */
async function updateLoadBalancerAddressTypeConfigWithOptions(request: UpdateLoadBalancerAddressTypeConfigRequest, runtime: $RuntimeOptions): UpdateLoadBalancerAddressTypeConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.addressType)) {
    query['AddressType'] = request.addressType;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.zoneMappings)) {
    query['ZoneMappings'] = request.zoneMappings;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateLoadBalancerAddressTypeConfig',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the network type of an Application Load Balancer (ALB) instance.
 *
 * @description ## Prerequisites
 * *   An ALB instance is created. For more information about how to create an ALB instance, see [CreateLoadBalancer](https://help.aliyun.com/document_detail/214358.html).
 * *   If you want to change the network type from internal-facing to Internet-facing, you must first create an elastic IP address (EIP). For more information, see [AllocateEipAddress](https://help.aliyun.com/document_detail/120192.html).
 * ## Usage notes
 * **UpdateLoadBalancerAddressTypeConfig** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the status of the task.
 * *   If an ALB instance is in the **Configuring** state, the network type is being changed.
 * *   If an ALB instance is in the **Active** state, the network type has been changed.
 *
 * @param request UpdateLoadBalancerAddressTypeConfigRequest
 * @return UpdateLoadBalancerAddressTypeConfigResponse
 */
async function updateLoadBalancerAddressTypeConfig(request: UpdateLoadBalancerAddressTypeConfigRequest): UpdateLoadBalancerAddressTypeConfigResponse {
  var runtime = new $RuntimeOptions{};
  return updateLoadBalancerAddressTypeConfigWithOptions(request, runtime);
}

model UpdateLoadBalancerAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false**: performs a dry run and sends the request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed. This is the default value.', example='true'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the ALB instance.

This parameter is required.', example='alb-o9ulmq5hgn68jk****'),
  loadBalancerName?: string(name='LoadBalancerName', description='The name of the ALB instance. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='lb-instance-test'),
  modificationProtectionConfig?: {
    reason?: string(name='Reason', description='It must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

This parameter takes effect only when **ModificationProtectionStatus** is set to **ConsoleProtection**.', example='test'),
    status?: string(name='Status', description='The status of the configuration read-only mode. Valid values:

*   **NonProtection**: disables the configuration read-only mode. In this case, you cannot specify **ModificationProtectionReason**. If you specify **ModificationProtectionReason**, the value of the parameter is cleared.
*   **ConsoleProtection**: enables the configuration read-only mode. In this case, you can specify **ModificationProtectionReason**.

> If you set this parameter to **ConsoleProtection**, you cannot use the ALB console to modify instance configurations. However, you can call API operations to modify instance configurations.', example='ConsoleProtection'),
  }(name='ModificationProtectionConfig', description='The configuration read-only mode.'),
}

model UpdateLoadBalancerAttributeResponseBody = {
  jobId?: string(name='JobId', description='The ID of the synchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model UpdateLoadBalancerAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLoadBalancerAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the attributes of an Application Load Balancer (ALB) instance, such as the name and the configuration read-only mode.
 *
 * @description **UpdateLoadBalancerAttribute** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) to query the status of the task.
 * *   If the ALB instance is in the **Configuring** state, the ALB instance is being modified.
 * *   If the ALB instance is in the **Active** state, the ALB instance is modified.
 *
 * @param request UpdateLoadBalancerAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLoadBalancerAttributeResponse
 */
async function updateLoadBalancerAttributeWithOptions(request: UpdateLoadBalancerAttributeRequest, runtime: $RuntimeOptions): UpdateLoadBalancerAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.loadBalancerName)) {
    query['LoadBalancerName'] = request.loadBalancerName;
  }
  if (!$isNull(request.modificationProtectionConfig)) {
    query['ModificationProtectionConfig'] = request.modificationProtectionConfig;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateLoadBalancerAttribute',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the attributes of an Application Load Balancer (ALB) instance, such as the name and the configuration read-only mode.
 *
 * @description **UpdateLoadBalancerAttribute** is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) to query the status of the task.
 * *   If the ALB instance is in the **Configuring** state, the ALB instance is being modified.
 * *   If the ALB instance is in the **Active** state, the ALB instance is modified.
 *
 * @param request UpdateLoadBalancerAttributeRequest
 * @return UpdateLoadBalancerAttributeResponse
 */
async function updateLoadBalancerAttribute(request: UpdateLoadBalancerAttributeRequest): UpdateLoadBalancerAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateLoadBalancerAttributeWithOptions(request, runtime);
}

model UpdateLoadBalancerEditionRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='false'),
  loadBalancerEdition?: string(name='LoadBalancerEdition', description='The edition of the ALB instance. Different editions have different limits and support different billing methods.

*   **Basic**: basic
*   **Standard**: standard
*   **StandardWithWaf**: WAF-enabled

This parameter is required.', example='Standard'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the ALB instance.

This parameter is required.', example='lb-bp1b6c719dfa08ex****'),
}

model UpdateLoadBalancerEditionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
}

model UpdateLoadBalancerEditionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLoadBalancerEditionResponseBody(name='body'),
}

/**
 * @summary Changes the edition of an Application Load Balancer (ALB) instance.
 *
 * @description *   You can only upgrade a basic ALB instance to a standard ALB instance or a WAF-enabled ALB instance. You cannot downgrade a standard ALB instance or a WAF-enabled ALB instance to a basic ALB instance. For more information, see [Upgrade an ALB instance](https://help.aliyun.com/document_detail/214654.html).
 * *   **UpdateLoadBalancerEdition** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the status of an ALB instance.
 *     *   If the ALB instance is in the **Configuring** state, the edition of the ALB instance is being modified.
 *     *   If the ALB instance is in the **Active** state, the edition of the ALB instance is modified.
 *
 * @param request UpdateLoadBalancerEditionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLoadBalancerEditionResponse
 */
async function updateLoadBalancerEditionWithOptions(request: UpdateLoadBalancerEditionRequest, runtime: $RuntimeOptions): UpdateLoadBalancerEditionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerEdition)) {
    query['LoadBalancerEdition'] = request.loadBalancerEdition;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateLoadBalancerEdition',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the edition of an Application Load Balancer (ALB) instance.
 *
 * @description *   You can only upgrade a basic ALB instance to a standard ALB instance or a WAF-enabled ALB instance. You cannot downgrade a standard ALB instance or a WAF-enabled ALB instance to a basic ALB instance. For more information, see [Upgrade an ALB instance](https://help.aliyun.com/document_detail/214654.html).
 * *   **UpdateLoadBalancerEdition** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation to query the status of an ALB instance.
 *     *   If the ALB instance is in the **Configuring** state, the edition of the ALB instance is being modified.
 *     *   If the ALB instance is in the **Active** state, the edition of the ALB instance is modified.
 *
 * @param request UpdateLoadBalancerEditionRequest
 * @return UpdateLoadBalancerEditionResponse
 */
async function updateLoadBalancerEdition(request: UpdateLoadBalancerEditionRequest): UpdateLoadBalancerEditionResponse {
  var runtime = new $RuntimeOptions{};
  return updateLoadBalancerEditionWithOptions(request, runtime);
}

model UpdateLoadBalancerZonesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='true'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the ALB instance.

This parameter is required.', example='lb-bp1b6c719dfa08ex****'),
  zoneMappings?: [ 
    {
      eipType?: string(name='EipType', description='The type of EIP. Valid values:

*   **Common**: an EIP.
*   **Anycast**: an Anycast EIP.

>  For more information about the regions in which ALB supports Anycast EIPs, see [Limits](https://help.aliyun.com/document_detail/460727.html).', example='Common'),
      intranetAddress?: string(name='IntranetAddress', description='The private IPv4 address. You must specify at least two zones. You can specify a maximum of 10 zones.', example='192.168.10.1'),
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch in the zone. By default, each zone contains one vSwitch and one subnet. You can specify at most 10 zones. If the region supports two or more zones, specify at least two zones.

This parameter is required.', example='vsw-bp1rmcrwg3erh1fh8****'),
      zoneId?: string(name='ZoneId', description='The zone name. You can call the [DescribeZones](https://help.aliyun.com/document_detail/189196.html) operation to query the most recent zone list. You can specify at most 10 zones. If the region supports two or more zones, specify at least two zones.

This parameter is required.', example='cn-hangzhou-a'),
    }
  ](name='ZoneMappings', description='The zones and the vSwitches in the zones. You can specify a maximum of 10 zones. If the selected region supports two or more zones, select at least two zones to ensure the high availability of your service. The specified zones and vSwitches overwrite the existing configurations.

This parameter is required.'),
}

model UpdateLoadBalancerZonesResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model UpdateLoadBalancerZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLoadBalancerZonesResponseBody(name='body'),
}

/**
 * @summary Modifies the zones of an Application Load Balancer (ALB) instance.
 *
 * @description **UpdateLoadBalancerZones** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) to query the status of the task.
 * *   If an ALB instance is in the **Configuring** state, the zones are being modified.
 * *   If an ALB instance is in the **Active** state, the zones are modified.
 * > You may be charged after you call UpdateLoadBalancerZones.
 *
 * @param request UpdateLoadBalancerZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLoadBalancerZonesResponse
 */
async function updateLoadBalancerZonesWithOptions(request: UpdateLoadBalancerZonesRequest, runtime: $RuntimeOptions): UpdateLoadBalancerZonesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.zoneMappings)) {
    query['ZoneMappings'] = request.zoneMappings;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateLoadBalancerZones',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the zones of an Application Load Balancer (ALB) instance.
 *
 * @description **UpdateLoadBalancerZones** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) to query the status of the task.
 * *   If an ALB instance is in the **Configuring** state, the zones are being modified.
 * *   If an ALB instance is in the **Active** state, the zones are modified.
 * > You may be charged after you call UpdateLoadBalancerZones.
 *
 * @param request UpdateLoadBalancerZonesRequest
 * @return UpdateLoadBalancerZonesResponse
 */
async function updateLoadBalancerZones(request: UpdateLoadBalancerZonesRequest): UpdateLoadBalancerZonesResponse {
  var runtime = new $RuntimeOptions{};
  return updateLoadBalancerZonesWithOptions(request, runtime);
}

model UpdateRuleAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='false'),
  priority?: int32(name='Priority', description='The priority of the forwarding rule. Valid values: **1 to 10000**. A lower value specifies a higher priority.

> The priorities of the forwarding rules created for the same listener must be unique.', example='10'),
  ruleActions?: [ 
    {
      corsConfig?: {
        allowCredentials?: string(name='AllowCredentials', description='Specifies whether to allow credentials to be carried in CORS requests. Valid values:

*   **on**
*   **off**', example='on'),
        allowHeaders?: [ string ](name='AllowHeaders', description='The trusted headers of CORS requests.'),
        allowMethods?: [ string ](name='AllowMethods', description='The trusted HTTP methods of CORS requests.'),
        allowOrigin?: [ string ](name='AllowOrigin', description='The trusted origins. You can specify one or more values, or only an asterisk (`*`).

*   The value must start with `http://` or `https://`, and be followed by a valid domain name, including top-level wildcard domain names. Example: `http://*.test.abc.example.com`.
*   You can specify ports for a single value. Valid values: **1** to **65535**.'),
        exposeHeaders?: [ string ](name='ExposeHeaders', description='The headers that can be exposed.'),
        maxAge?: long(name='MaxAge', description='The maximum cache time of dry runs in the browser. Unit: seconds.

Valid values: **-1** to **172800**.', example='1000'),
      }(name='CorsConfig', description='The CORS configuration.'),
      fixedResponseConfig?: {
        content?: string(name='Content', description='The content of the response. The content can be up to 1 KB in size, and can contain only ASCII characters.', example='dssacav'),
        contentType?: string(name='ContentType', description='The content type.

Valid values: **text/plain**, **text/css**, **text/html**, **application/javascript**, and **application/json**.', example='text/plain'),
        httpCode?: string(name='HttpCode', description='The HTTP status code in responses. Valid values: **2xx**, **4xx**, **5xx**. The value must be a numeric string. **x** must be a digit.', example='HTTP_200'),
      }(name='FixedResponseConfig', description='The configuration of the custom response.'),
      forwardGroupConfig?: {
        serverGroupStickySession?: {
          enabled?: boolean(name='Enabled', description='Specifies whether to enable session persistence. Valid values:

*   **true**: enables session persistence.
*   **false** (default)', example='false'),
          timeout?: int32(name='Timeout', description='The timeout period of sessions. Unit: seconds Valid values: 1 to 86400.', example='2'),
        }(name='ServerGroupStickySession', description='The configuration of session persistence.'),
        serverGroupTuples?: [ 
          {
            serverGroupId?: string(name='ServerGroupId', description='The ID of the server group to which requests are forwarded.', example='sg--atstuj3rtoptyui****'),
            weight?: int32(name='Weight', description='The weight of the server group. A larger value specifies a higher weight. A server group with a higher weight receives more requests. Valid values: **0** to **100**.

*   If the number of destination server groups is 1, the default weight of the server group is **100**, unless you specify a weight.
*   If the number of destination server groups is larger than 1, you must specify a weight.', example='30'),
          }
        ](name='ServerGroupTuples', description='The server groups to which requests are forwarded.'),
      }(name='ForwardGroupConfig', description='The configurations of the server groups.'),
      insertHeaderConfig?: {
        coverEnabled?: boolean(name='CoverEnabled', description='Specifies whether to overwrite the request header values. Valid values:

*   **true**: overwrites the request header.
*   **false** (default): does not overwrite the request header.', example='false'),
        key?: string(name='Key', description='The key of the header. The key must be 1 to 40 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The header keys specified by **InsertHeaderConfig** must be unique.

> The following header keys are not supported: `slb-id`, `slb-ip`, `x-forwarded-for`, `x-forwarded-proto`, `x-forwarded-eip`, `x-forwarded-port`, `x-forwarded-client-srcport`, `connection`, `upgrade`, `content-length`, `transfer-encoding`, `keep-alive`, `te`, `host`, `cookie`, `remoteip`, and `authority`. The header keys are not case-sensitive.', example='key'),
        value?: string(name='Value', description='The value of the header.

*   If **ValueType** is set to **SystemDefined**, you can set the Value parameter to one of the following values:

    *   **ClientSrcPort**: the client port.
    *   **ClientSrcIp**: the IP address of the client.
    *   **Protocol**: the request protocol (HTTP or HTTPS).
    *   **SLBId**: the ID of the ALB instance.
    *   **SLBPort**: the listener port of the ALB instance.

*   If **ValueType** is set to **UserDefined**, you can specify a custom value. The value must be 1 to 128 characters in length, and can contain asterisks (\\\\*), question marks (?), and printable characters whose ASCII values are `larger than or equal to 32 and smaller than 127`. It cannot start or end with a space character.

*   If **ValueType** is set to **ReferenceHeader**, you can reference a value from request headers. The value must be 1 to 128 characters in length, and can contain lowercase letters, digits, hyphens (-), and underscores (_).', example='UserDefined'),
        valueType?: string(name='ValueType', description='The type of the header. Valid values:

*   **UserDefined**: a custom header.
*   **ReferenceHeader**: a header that references one of the request headers.
*   **SystemDefined**: a system-defined header value.', example='UserDefined'),
      }(name='InsertHeaderConfig', description='The configuration of the header to be inserted.'),
      order?: int32(name='Order', description='The priority of the action. Valid values: **1 to 50000**. A smaller value specifies a higher priority. The actions of a forwarding rule are applied in descending order of priority. This parameter is required. The priority of each action within a forwarding rule must be unique. You can specify at most 20 forwarding rule priorities.', example='1'),
      redirectConfig?: {
        host?: string(name='Host', description='The hostname to which requests are redirected. Valid values:

*   **${host}** (default): If ${host} is returned, no other character is appended.

*   If you want to specify a custom value, make sure that the following requirements are met:

    *   The hostname must be 3 to 128 characters in length, and can contain lowercase letters, digits, hyphens (-), periods (.), asterisks (\\\\*), and question marks (?).
    *   The hostname must contain at least one period (.) but cannot start or end with a period (.).
    *   The rightmost domain label can contain only letters and wildcard characters. It cannot contain digits or hyphens (-).
    *   Other domain labels cannot start or end with a hyphen (-).
    *   You can use asterisks (\\\\*) and question marks (?) anywhere in a domain label as wildcard characters.', example='www.example.com'),
        httpCode?: string(name='HttpCode', description='The forwarding method. Valid values: **301**, **302**, **303**, **307**, and **308**.', example='301'),
        path?: string(name='Path', description='The URL to which requests are redirected. Valid values:

*   Default value: **${path}**. \\\\*\\\\*${host}**, **${protocol}**, and **${port}\\\\*\\\\* are also supported. Each variable can be specified only once. The preceding variables can be used at the same time or combined with a custom value.

*   If you want to specify a custom value, make sure that the following requirements are met:

    *   The URL must be 1 to 128 characters in length,
    *   The URL must start with a forward slash (/) and can contain letters, digits, and the following special characters: `$ - _ .+ / & ~ @ :`. It cannot contain the following special characters: `" % # ; ! ( ) [ ]^ , "`. You can use asterisks (\\\\*) and question marks (?) as wildcard characters.', example='/test'),
        port?: string(name='Port', description='The port to which requests are redirected. Valid values:

*   **${port}** (default): If you set the value to ${port}, you cannot append other characters.
*   Other valid values: **1 to 63335**.', example='10'),
        protocol?: string(name='Protocol', description='The redirect protocol. Valid values:

*   **${protocol}** (default): If you set the value to ${protocol}, you cannot append other characters.
*   **HTTP** or **HTTPS**.

> HTTPS listeners support only HTTPS redirects.', example='HTTP'),
        query?: string(name='Query', description='The query string to which requests are redirected. Valid values:

*   Default value: **${query}**. \\\\*\\\\*${host}**, **${protocol}**, and **${port}\\\\*\\\\* are also supported. Each variable can be specified only once. The preceding variables can be used at the same time or combined with a custom value.

*   If you want to specify a custom value, make sure that the following requirements are met:

    *   The query string must be 1 to 128 characters in length.
    *   The query string can contain printable characters, but cannot contain space characters, the special characters `# [ ] { } \\\\ | < > &`, or uppercase letters.', example='quert'),
      }(name='RedirectConfig', description='The configuration of the redirect action. You can specify at most 20 redirect actions.'),
      removeHeaderConfig?: {
        key?: string(name='Key', description='The key of the header to be removed. The header key must be 1 to 40 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The header keys specified in RemoveHeader must be unique.

*   If Direction is set to Request, the following request header keys are not supported: `slb-id`, `slb-ip`, `x-forwarded-for`, `x-forwarded-proto`, `x-forwarded-eip`, `x-forwarded-port`, `x-forwarded-client-srcport`, `connection`, `upgrade`, `content-length`, `transfer-encoding`, `keep-alive`, `te`, `host`, `cookie`, `remoteip`, and `authority`. The header keys are not case-sensitive.
*   If Direction is set to Response, the following header keys are not supported: `connection`, `upgrade`, `content-length`, and `transfer-encoding`. The header keys are not case-sensitive.', example='test'),
      }(name='RemoveHeaderConfig', description='The HTTP header to be removed.'),
      rewriteConfig?: {
        host?: string(name='Host', description='The hostname to which requests are rewritten. Valid values:

*   **${host}** (default): If you set the value to ${host}, you cannot append other characters.

*   If you want to specify a custom value, make sure that the following requirements are met:

    *   The hostname must be 3 to 128 characters in length, and can contain lowercase letters, digits, hyphens (-), periods (.), asterisks (\\\\*), and question marks (?).
    *   The hostname contains at least one period (.) but does not start or end with a period (.).
    *   The rightmost domain label can contain only letters and wildcard characters. It cannot contain digits or hyphens (-).
    *   Other domain labels cannot start or end with a hyphen (-). You can use asterisks (\\\\*) and question marks (?) anywhere in a domain label as wildcard characters.', example='www.example.com'),
        path?: string(name='Path', description='The URL to which requests are redirected. Valid values:

*   Default value: **${path}**. \\\\*\\\\*${host}**, **${protocol}**, and **${port}\\\\*\\\\* are also supported. Each variable can be specified only once. The preceding variables can be used at the same time or combined with a custom value.

*   If you want to specify a custom value, make sure that the following requirements are met:

    *   The URL must be 1 to 128 characters in length,
    *   The URL must start with a forward slash (/) and can contain letters, digits, and the following special characters: `$ - _ .+ / & ~ @ :`. It cannot contain the following special characters: `" % # ; ! ( ) [ ]^ , "`. You can use asterisks (\\\\*) and question marks (?) as wildcard characters.', example='/tsdf'),
        query?: string(name='Query', description='The query string to which requests are redirected. Valid values:

*   Default value: **${query}**. \\\\*\\\\*${host}**, **${protocol}**, and **${port}\\\\*\\\\* are also supported. Each variable can be specified only once. The preceding variables can be used at the same time or combined with a custom value.

*   If you want to specify a custom value, make sure that the following requirements are met:

    *   The query string must be 1 to 128 characters in length.
    *   The query string can contain printable characters, but cannot contain space characters, the special characters `# [ ] { } \\\\ | < > &`, or uppercase letters.', example='quedsa'),
      }(name='RewriteConfig', description='The configuration of the rewrite action.'),
      trafficLimitConfig?: {
        perIpQps?: int32(name='PerIpQps', description='The number of requests per IP address. Value range: **1 to 1000000**.

> If both the **QPS** and **PerIpQps** parameters are specified, make sure that the value of the **QPS** parameter is smaller than the value of the PerIpQps parameter.', example='80'),
        QPS?: int32(name='QPS', description='The queries per second (QPS). Value range: **1 to 1000000**.', example='100'),
      }(name='TrafficLimitConfig', description='The configuration of the action to throttle traffic.'),
      trafficMirrorConfig?: {
        mirrorGroupConfig?: {
          serverGroupTuples?: [ 
            {
              serverGroupId?: string(name='ServerGroupId', description='The server group ID.', example='srg-00mkgijak0w4qgz9****'),
            }
          ](name='ServerGroupTuples', description='The server group to which network traffic is mirrored.'),
        }(name='MirrorGroupConfig', description='The server group to which network traffic is mirrored.'),
        targetType?: string(name='TargetType', description='The type of destination to which network traffic is mirrored. Valid values:

*   **ForwardGroupMirror**: a server group', example='ForwardGroupMirror'),
      }(name='TrafficMirrorConfig', description='The configuration of the traffic mirroring action.'),
      type?: string(name='Type', description='The type of the task. You can specify at most 11 types of action. Valid values:

*   **ForwardGroup**: forwards requests to multiple vServer groups.
*   **Redirect**: redirects requests.
*   **FixedResponse**: returns a fixed response.
*   **Rewrite**: rewrites requests.
*   **InsertHeader**: inserts a header.
*   **RemoveHeader**: removes headers.
*   **TrafficLimit**: throttles traffic.
*   **trafficMirror**: mirrors network traffic.
*   **Cors**: forwards requests based on CORS.

The preceding actions can be classified into two types:

*   **FinalType**: Each forwarding rule can contain only one FinalType action, which is performed at the end. You can specify only one of **ForwardGroup**, **Redirect**, and **FixedResponse**.
*   **ExtType**: Each forwarding rule can contain one or more **ExtType** actions, which are performed before the **FinalType** action. If you want to specify an ExtType action, you must also specify a **FinalType** action. You can specify multiple **InsertHeader** actions or one **Rewrite** action.', example='ForwardGroup'),
    }
  ](name='RuleActions', description='The actions of the forwarding rule.'),
  ruleConditions?: [ 
    {
      cookieConfig?: {
        values?: [ 
          {
            key?: string(name='Key', description='The cookie key. The cookie key must be 1 to 100 characters in length, and can contain lowercase letters, printable ASCII characters, asterisks (\\\\*), and question marks (?). It cannot contain space characters or the following special characters: `# [ ] { } \\\\ | < > &`.', example='test'),
            value?: string(name='Value', description='The cookie value. The cookie value must be 1 to 128 characters in length, and can contain lowercase letters, printable ASCII characters, asterisks (\\\\*), and question marks (?). It cannot contain space characters or the following special characters: `# [ ] { } \\\\ | < > &`.', example='test'),
          }
        ](name='Values', description='The key-value pairs of the cookie.'),
      }(name='CookieConfig', description='The key-value pairs of the cookie.'),
      headerConfig?: {
        key?: string(name='Key', description='The key of the response header. The header key must be 1 to 40 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). Cookie and Host are not supported.', example='Port'),
        values?: [ string ](name='Values', description='The header values.'),
      }(name='HeaderConfig', description='The configuration of the header.'),
      hostConfig?: {
        values?: [ string ](name='Values', description='The hostnames.'),
      }(name='HostConfig', description='The configurations of the hosts.'),
      methodConfig?: {
        values?: [ string ](name='Values', description='The request methods.'),
      }(name='MethodConfig', description='The configuration of the request method.'),
      pathConfig?: {
        values?: [ string ](name='Values', description='The URLs to which requests are forwarded.'),
      }(name='PathConfig', description='The configurations of the forwarding URL.'),
      queryStringConfig?: {
        values?: [ 
          {
            key?: string(name='Key', description='The key of the query string. The key must be 1 to 100 characters in length, and can contain lowercase letters, printable ASCII characters, asterisks (\\\\*), and question marks (?). It cannot contain space characters or the following special characters: `# [ ] { } \\\\ | < > &`.', example='test'),
            value?: string(name='Value', description='The value of the query string. The value must be 1 to 128 characters in length, and can contain lowercase letters, printable ASCII characters, asterisks (\\\\*), and question marks (?). It cannot contain space characters or the following special characters: `# [ ] { } \\\\ | < > &`.', example='test'),
          }
        ](name='Values', description='The query strings. You can specify at most 20 query strings.'),
      }(name='QueryStringConfig', description='The configurations of the query strings.'),
      responseHeaderConfig?: {
        key?: string(name='Key', description='The header key.

*   The header key must be 1 to 40 characters in length.
*   The header key can contain lowercase letters, digits, hyphens (-), and underscores (_).
*   Cookie and Host are not supported.', example='test'),
        values?: [ string ](name='Values', description='The header values.'),
      }(name='ResponseHeaderConfig', description='The configuration of headers.'),
      responseStatusCodeConfig?: {
        values?: [ string ](name='Values', description='The response status codes.'),
      }(name='ResponseStatusCodeConfig', description='The configurations of the response status codes.'),
      sourceIpConfig?: {
        values?: [ string ](name='Values', description='You can add one or more IP addresses, including CIDR blocks.'),
      }(name='SourceIpConfig', description='Traffic matching based on source IP addresses. You can specify at most five IP addresses, including CIDR blocks.'),
      type?: string(name='Type', description='The type of forwarding rule. You can specify at most seven types of forwarding rule. Valid values:

*   **Host**: Requests are forwarded based on hosts.
*   **Path**: Requests are forwarded based on paths.
*   **Header**: Requests are forwarded based on HTTP headers.
*   **QueryString**: Requests are forwarded based on query strings.
*   **Method**: Requests are forwarded based on request methods.
*   **Cookie**: Requests are forwarded based on cookies.
*   **SourceIp**: Responses are forwarded based on source IP addresses.
*   **ResponseHeader**: Requests are forwarded based on HTTP response headers.
*   **ResponseStatusCode**: Requests are forwarded based on response status codes.', example='Host'),
    }
  ](name='RuleConditions', description='The match condition of the forwarding rule.'),
  ruleId?: string(name='RuleId', description='The ID of the forwarding rule.

This parameter is required.', example='rule-4dp5i6ea****'),
  ruleName?: string(name='RuleName', description='The name of the forwarding rule. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='rule-instance-test'),
}

model UpdateRuleAttributeResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F5378-41F6-4AE4-92F8-7FF34B540710'),
}

model UpdateRuleAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateRuleAttributeResponseBody(name='body'),
}

/**
 * @summary Updates a forwarding rule, such as the match condition, action, and name.
 *
 * @description *   **UpdateRuleAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListRules](https://help.aliyun.com/document_detail/214379.html) operation to query the status of a forwarding rule:
 *     *   If a forwarding rule is in the **Configuring** state, the forwarding rule is being updated.
 *     *   If a forwarding rule is in the **Available** state, the forwarding rule is updated.
 * *   You can set **RuleConditions** and **RuleActions** to add conditions and actions to a forwarding rule. Take note of the following limits on the number of conditions and the number of actions in each forwarding rule:
 *     *   Number of conditions: You can specify at most 5 for a basic Application Load Balancer (ALB) instance, at most 10 for a standard ALB instance, and at most 10 for a WAF-enabled ALB instance.
 *     *   Number of actions: You can specify at most 3 for a basic ALB instance, at most 5 for a standard ALB instance, and at most 5 for a WAF-enabled ALB instance.
 *
 * @param request UpdateRuleAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateRuleAttributeResponse
 */
async function updateRuleAttributeWithOptions(request: UpdateRuleAttributeRequest, runtime: $RuntimeOptions): UpdateRuleAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!$isNull(request.ruleActions)) {
    query['RuleActions'] = request.ruleActions;
  }
  if (!$isNull(request.ruleConditions)) {
    query['RuleConditions'] = request.ruleConditions;
  }
  if (!$isNull(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!$isNull(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateRuleAttribute',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates a forwarding rule, such as the match condition, action, and name.
 *
 * @description *   **UpdateRuleAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListRules](https://help.aliyun.com/document_detail/214379.html) operation to query the status of a forwarding rule:
 *     *   If a forwarding rule is in the **Configuring** state, the forwarding rule is being updated.
 *     *   If a forwarding rule is in the **Available** state, the forwarding rule is updated.
 * *   You can set **RuleConditions** and **RuleActions** to add conditions and actions to a forwarding rule. Take note of the following limits on the number of conditions and the number of actions in each forwarding rule:
 *     *   Number of conditions: You can specify at most 5 for a basic Application Load Balancer (ALB) instance, at most 10 for a standard ALB instance, and at most 10 for a WAF-enabled ALB instance.
 *     *   Number of actions: You can specify at most 3 for a basic ALB instance, at most 5 for a standard ALB instance, and at most 5 for a WAF-enabled ALB instance.
 *
 * @param request UpdateRuleAttributeRequest
 * @return UpdateRuleAttributeResponse
 */
async function updateRuleAttribute(request: UpdateRuleAttributeRequest): UpdateRuleAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateRuleAttributeWithOptions(request, runtime);
}

model UpdateRulesAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The client token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx HTTP` status code is returned and the operation is performed.', example='false'),
  rules?: [ 
    {
      priority?: int32(name='Priority'),
      ruleActions?: [ 
        {
          corsConfig?: {
            allowCredentials?: string(name='AllowCredentials'),
            allowHeaders?: [ string ](name='AllowHeaders'),
            allowMethods?: [ string ](name='AllowMethods'),
            allowOrigin?: [ string ](name='AllowOrigin'),
            exposeHeaders?: [ string ](name='ExposeHeaders'),
            maxAge?: long(name='MaxAge'),
          }(name='CorsConfig'),
          fixedResponseConfig?: {
            content?: string(name='Content'),
            contentType?: string(name='ContentType'),
            httpCode?: string(name='HttpCode'),
          }(name='FixedResponseConfig'),
          forwardGroupConfig?: {
            serverGroupStickySession?: {
              enabled?: boolean(name='Enabled'),
              timeout?: int32(name='Timeout'),
            }(name='ServerGroupStickySession'),
            serverGroupTuples?: [ 
              {
                serverGroupId?: string(name='ServerGroupId'),
                weight?: int32(name='Weight'),
              }
            ](name='ServerGroupTuples'),
          }(name='ForwardGroupConfig'),
          insertHeaderConfig?: {
            coverEnabled?: boolean(name='CoverEnabled'),
            key?: string(name='Key'),
            value?: string(name='Value'),
            valueType?: string(name='ValueType'),
          }(name='InsertHeaderConfig'),
          order?: int32(name='Order', description='This parameter is required.'),
          redirectConfig?: {
            host?: string(name='Host'),
            httpCode?: string(name='HttpCode'),
            path?: string(name='Path'),
            port?: string(name='Port'),
            protocol?: string(name='Protocol'),
            query?: string(name='Query'),
          }(name='RedirectConfig'),
          removeHeaderConfig?: {
            key?: string(name='Key'),
          }(name='RemoveHeaderConfig'),
          rewriteConfig?: {
            host?: string(name='Host'),
            path?: string(name='Path'),
            query?: string(name='Query'),
          }(name='RewriteConfig'),
          trafficLimitConfig?: {
            perIpQps?: int32(name='PerIpQps'),
            QPS?: int32(name='QPS'),
          }(name='TrafficLimitConfig'),
          trafficMirrorConfig?: {
            mirrorGroupConfig?: {
              serverGroupTuples?: [ 
                {
                  serverGroupId?: string(name='ServerGroupId'),
                }
              ](name='ServerGroupTuples'),
            }(name='MirrorGroupConfig'),
            targetType?: string(name='TargetType'),
          }(name='TrafficMirrorConfig'),
          type?: string(name='Type', description='This parameter is required.'),
        }
      ](name='RuleActions'),
      ruleConditions?: [ 
        {
          cookieConfig?: {
            values?: [ 
              {
                key?: string(name='Key'),
                value?: string(name='Value'),
              }
            ](name='Values'),
          }(name='CookieConfig'),
          headerConfig?: {
            key?: string(name='Key'),
            values?: [ string ](name='Values'),
          }(name='HeaderConfig'),
          hostConfig?: {
            values?: [ string ](name='Values'),
          }(name='HostConfig'),
          methodConfig?: {
            values?: [ string ](name='Values'),
          }(name='MethodConfig'),
          pathConfig?: {
            values?: [ string ](name='Values'),
          }(name='PathConfig'),
          queryStringConfig?: {
            values?: [ 
              {
                key?: string(name='Key'),
                value?: string(name='Value'),
              }
            ](name='Values'),
          }(name='QueryStringConfig'),
          responseHeaderConfig?: {
            key?: string(name='Key'),
            values?: [ string ](name='Values'),
          }(name='ResponseHeaderConfig'),
          responseStatusCodeConfig?: {
            values?: [ string ](name='Values'),
          }(name='ResponseStatusCodeConfig'),
          sourceIpConfig?: {
            values?: [ string ](name='Values'),
          }(name='SourceIpConfig'),
          type?: string(name='Type'),
        }
      ](name='RuleConditions'),
      ruleId?: string(name='RuleId', description='This parameter is required.'),
      ruleName?: string(name='RuleName'),
    }
  ](name='Rules', description='This parameter is required.'),
}

model UpdateRulesAttributeResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model UpdateRulesAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateRulesAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the attributes of forwarding rules.
 *
 * @description **UpdateRulesAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListRules](https://help.aliyun.com/document_detail/214379.html) operation to query the status of the task.
 * *   If a forwarding rule is in the **Configuring** state, the forwarding rule is being updated.
 * *   If a forwarding rule is in the **Available** state, the forwarding rule is updated.
 * *   You can set **RuleConditions** and **RuleActions** to add conditions and actions to a forwarding rule. Take note of the following limits on the maximum number of conditions and the maximum number of actions in each forwarding rule:
 *     *   Limits on conditions: 5 for a basic Application Load Balancer (ALB) instance, 10 for a standard ALB instance, and 10 for a WAF-enabled ALB instance.
 *     *   Limits on actions: 3 for a basic ALB instance, 5 for a standard ALB instance, and 5 for a WAF-enabled ALB instance.
 *
 * @param request UpdateRulesAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateRulesAttributeResponse
 */
async function updateRulesAttributeWithOptions(request: UpdateRulesAttributeRequest, runtime: $RuntimeOptions): UpdateRulesAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!$isNull(request.rules)) {
    bodyFlat['Rules'] = request.rules;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateRulesAttribute',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the attributes of forwarding rules.
 *
 * @description **UpdateRulesAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListRules](https://help.aliyun.com/document_detail/214379.html) operation to query the status of the task.
 * *   If a forwarding rule is in the **Configuring** state, the forwarding rule is being updated.
 * *   If a forwarding rule is in the **Available** state, the forwarding rule is updated.
 * *   You can set **RuleConditions** and **RuleActions** to add conditions and actions to a forwarding rule. Take note of the following limits on the maximum number of conditions and the maximum number of actions in each forwarding rule:
 *     *   Limits on conditions: 5 for a basic Application Load Balancer (ALB) instance, 10 for a standard ALB instance, and 10 for a WAF-enabled ALB instance.
 *     *   Limits on actions: 3 for a basic ALB instance, 5 for a standard ALB instance, and 5 for a WAF-enabled ALB instance.
 *
 * @param request UpdateRulesAttributeRequest
 * @return UpdateRulesAttributeResponse
 */
async function updateRulesAttribute(request: UpdateRulesAttributeRequest): UpdateRulesAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateRulesAttributeWithOptions(request, runtime);
}

model UpdateSecurityPolicyAttributeRequest {
  ciphers?: [ string ](name='Ciphers', description='The supported cipher suites.'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The security policy ID.

This parameter is required.', example='spy-n0kn923****'),
  securityPolicyName?: string(name='SecurityPolicyName', description='The name of the security policy.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='test-secrity'),
  TLSVersions?: [ string ](name='TLSVersions', description='The supported TLS protocol versions.'),
}

model UpdateSecurityPolicyAttributeResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
}

model UpdateSecurityPolicyAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSecurityPolicyAttributeResponseBody(name='body'),
}

/**
 * @summary Updates the attributes of a security policy, such as the TLS protocol version and the supported cipher suites.
 *
 * @description ##
 * **UpdateSecurityPolicyAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [ListSecurityPolicies](https://help.aliyun.com/document_detail/213609.html) to query the status of the task.
 * *   If a security policy is in the **Configuring** state, the security policy is being updated.
 * *   If a security policy is in the **Available** state, the security policy is updated.
 *
 * @param request UpdateSecurityPolicyAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSecurityPolicyAttributeResponse
 */
async function updateSecurityPolicyAttributeWithOptions(request: UpdateSecurityPolicyAttributeRequest, runtime: $RuntimeOptions): UpdateSecurityPolicyAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ciphers)) {
    query['Ciphers'] = request.ciphers;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.securityPolicyId)) {
    query['SecurityPolicyId'] = request.securityPolicyId;
  }
  if (!$isNull(request.securityPolicyName)) {
    query['SecurityPolicyName'] = request.securityPolicyName;
  }
  if (!$isNull(request.TLSVersions)) {
    query['TLSVersions'] = request.TLSVersions;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateSecurityPolicyAttribute',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the attributes of a security policy, such as the TLS protocol version and the supported cipher suites.
 *
 * @description ##
 * **UpdateSecurityPolicyAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call [ListSecurityPolicies](https://help.aliyun.com/document_detail/213609.html) to query the status of the task.
 * *   If a security policy is in the **Configuring** state, the security policy is being updated.
 * *   If a security policy is in the **Available** state, the security policy is updated.
 *
 * @param request UpdateSecurityPolicyAttributeRequest
 * @return UpdateSecurityPolicyAttributeResponse
 */
async function updateSecurityPolicyAttribute(request: UpdateSecurityPolicyAttributeRequest): UpdateSecurityPolicyAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateSecurityPolicyAttributeWithOptions(request, runtime);
}

model UpdateServerGroupAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

> If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.', example='5A2CFF0E-5718-45B5-9D4D-70B3FF3898'),
  connectionDrainConfig?: {
    connectionDrainEnabled?: boolean(name='ConnectionDrainEnabled', description='Specifies whether to enable connection draining. Valid values:

*   **true**
*   **false**', example='false'),
    connectionDrainTimeout?: int32(name='ConnectionDrainTimeout', description='The timeout period of connection draining.

Valid values: **0** to **900**.', example='300'),
  }(name='ConnectionDrainConfig', description='The configurations of connection draining.

After connection draining is enabled, SLB remains data transmission for a period of time after a backend server is removed or declared unhealthy.

> *   Basic SLB instances do not support connection draining. Standard and WAF-enabled SLB instances support connection draining.
> *   Server groups of the server and IP types support connection draining. Server groups of the Function Compute type do not support connection draining.'),
  crossZoneEnabled?: boolean(name='CrossZoneEnabled', description='Indicates whether cross-zone load balancing is enabled for the server group. Valid values:

*   **true** (default)
*   **false**

> *   Basic ALB instances do not support server groups that have cross-zone load balancing disabled. Only Standard and WAF-enabled ALB instances support server groups that have cross-zone load balancing.
>*   Cross-zone load balancing can be disabled for server groups of the server and IP type, but not for server groups of the Function Compute type.
>*   When cross-zone load balancing is disabled, session persistence cannot be enabled.', example='true'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: checks the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a `2xx` HTTP status code is returned and the operation is performed.', example='true'),
  healthCheckConfig?: {
    healthCheckCodes?: [ string ](name='HealthCheckCodes', description='The HTTP status codes that indicate healthy backend servers.'),
    healthCheckConnectPort?: int32(name='HealthCheckConnectPort', description='The backend port that is used for health checks.

Valid values: **0** to **65535**.

If you set the value to **0**, the backend port is used for health checks.

>  This parameter takes effect only if you set **HealthCheckEnabled** to **true**.', example='80'),
    healthCheckEnabled?: boolean(name='HealthCheckEnabled', description='Specifies whether to enable the health check feature. Valid values:

*   **true**
*   **false**', example='true'),
    healthCheckHost?: string(name='HealthCheckHost', description='The domain name that is used for health checks.

*   **Backend Server Internal IP** (default): Use the internal IP address of backend servers as the health check domain name.

*   **Custom Domain Name**: Enter a domain name.

    *   The domain name must be 1 to 80 characters in length.
    *   The domain name can contain lowercase letters, digits, hyphens (-), and periods (.).
    *   The domain name must contain at least one period (.) but cannot start or end with a period (.).
    *   The rightmost domain label of the domain name can contain only letters, and cannot contain digits or hyphens (-).
    *   The domain name cannot start or end with a hyphen (-).

>  This parameter takes effect only if **HealthCheckProtocol** is set to **HTTP**, **HTTPS**, or **gRPC**.', example='example.com'),
    healthCheckHttpVersion?: string(name='HealthCheckHttpVersion', description='The HTTP version that is used for health checks. Valid values:

*   **HTTP1.0**
*   **HTTP1.1**

>  This parameter takes effect only if you set **HealthCheckEnabled** to true and **HealthCheckProtocol** to **HTTP** or **HTTPS**.', example='HTTP1.1'),
    healthCheckInterval?: int32(name='HealthCheckInterval', description='The interval at which health checks are performed. Unit: seconds.

Valid values: **1** to **50**.

>  This parameter takes effect only if you set **HealthCheckEnabled** to **true**.', example='5'),
    healthCheckMethod?: string(name='HealthCheckMethod', description='The HTTP method that is used for health checks. Valid values:

*   **GET**: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.
*   **POST**: gRPC health checks use the POST method by default.
*   **HEAD**: HTTP and HTTPS health checks use the HEAD method by default.

>  This parameter takes effect only if you set **HealthCheckEnabled** to true and **HealthCheckProtocol** to **HTTP**, **HTTPS**, or **gRPC**.', example='HEAD'),
    healthCheckPath?: string(name='HealthCheckPath', description='The URL that is used for health checks.

The URL must be 1 to 80 characters in length, and can contain letters, digits, and the following special characters: `- / . % ? # & =`. It can also contain the following extended characters: `_ ; ~ ! ( ) * [ ] @ $ ^ : \\\\" , +`. The URL must start with a forward slash (`/`).

>  This parameter takes effect only if you set **HealthCheckEnabled** to **true** and **HealthCheckProtocol** to **HTTP** or **HTTPS**.', example='/test/index.html'),
    healthCheckProtocol?: string(name='HealthCheckProtocol', description='The protocol that you want to use for health checks. Valid values:

*   **HTTP**: HTTP health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers.
*   **HTTPS**: HTTPS health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers. HTTPS supports encryption and provides higher security than HTTP.
*   **TCP**: TCP health checks send TCP SYN packets to a backend server to probe the availability of backend servers.
*   **gRPC**: gRPC health checks send POST or GET requests to a backend server to check whether the backend server is healthy.', example='HTTP'),
    healthCheckTimeout?: int32(name='HealthCheckTimeout', description='The timeout period of a health check response. If a backend ECS instance does not respond within the specified timeout period, the ECS instance fails the health check. Unit: seconds.

Valid values: **1** to **300**.

>  This parameter takes effect only if you set **HealthCheckEnabled** to **true**.', example='3'),
    healthyThreshold?: int32(name='HealthyThreshold', description='The number of times that an unhealthy backend server must consecutively pass health checks before it can be declared healthy. In this case, the health check status of the backend server changes from **fail** to **success**.

Valid values: **2** to **10**.', example='4'),
    unhealthyThreshold?: int32(name='UnhealthyThreshold', description='The number of times that a healthy backend server must consecutively fail health checks before it can be declared unhealthy. In this case, the health check status of the backend server changes from **success** to **fail**.

Valid values: **2** to **10**.', example='4'),
  }(name='HealthCheckConfig', description='The configuration of health checks.'),
  scheduler?: string(name='Scheduler', description='The scheduling algorithm. Valid values:

*   **Wrr**: the weighted round robin algorithm. Backend servers that have higher weights receive more requests than those that have lower weights.
*   **Wlc**: the weighted least connections algorithm. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.
*   **Sch**: the consistent hashing algorithm. Requests from the same source IP address are distributed to the same backend server.', example='Wrr'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

This parameter is required.', example='sgp-atstuj3rtop****'),
  serverGroupName?: string(name='ServerGroupName', description='The server group name.

The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='test'),
  serviceName?: string(name='ServiceName', description='This parameter is available only if the ALB Ingress controller is used. In this case, set this parameter to the name of the `Kubernetes Service` that is associated with the server group.', example='test2'),
  slowStartConfig?: {
    slowStartDuration?: int32(name='SlowStartDuration', description='The duration of a slow start.', example='30'),
    slowStartEnabled?: boolean(name='SlowStartEnabled', description='Indicates whether slow starts are enabled. Valid values:

*   **true**
*   **false**', example='false'),
  }(name='SlowStartConfig', description='The configurations of slow starts.

After slow starts are enabled, ALB prefetches data to newly added backend servers. Requests distributed to the backend servers gradually increase.

> *   Basic ALB instances do not support slow starts. Standard and WAF-enabled ALB instances support slow starts.
>*   Server groups of the instance and IP types support slow starts. Server groups of the Function Compute type do not support slow starts.
>*   Slow start is supported only by the weighted round-robin scheduling algorithm.'),
  stickySessionConfig?: {
    cookie?: string(name='Cookie', description='The cookie to be configured on the server.

The cookie must be 1 to 200 characters in length and can contain only ASCII characters and digits. It cannot contain commas (,), semicolons (;), or space characters. It cannot start with a dollar sign ($).

> This parameter takes effect when the **StickySessionEnabled** parameter is set to **true** and the **StickySessionType** parameter is set to **Server**.', example='B490B5EBF6F3CD402E515D22BCDA1598'),
    cookieTimeout?: int32(name='CookieTimeout', description='The timeout period of a cookie. Unit: seconds.

Valid values: **1** to **86400**.

> This parameter takes effect when the **StickySessionEnabled** parameter is set to **true** and the **StickySessionType** parameter is set to **Insert**.', example='1000'),
    stickySessionEnabled?: boolean(name='StickySessionEnabled', description='Specifies whether to enable session persistence. Valid values:

*   **true**
*   **false** (default)', example='false'),
    stickySessionType?: string(name='StickySessionType', description='The method that is used to handle a cookie. Valid values:

*   **Insert**: inserts a cookie.

ALB inserts a cookie (SERVERID) into the first HTTP or HTTPS response packet that is sent to a client. The next request from the client contains this cookie and the listener forwards this request to the recorded backend server.

*   **Server**: rewrites a cookie.

When ALB detects a user-defined cookie, it overwrites the original cookie with the user-defined cookie. Subsequent requests to ALB carry this user-defined cookie, and ALB determines the destination servers of the requests based on the cookies.

> This parameter takes effect when the **StickySessionEnabled** parameter is set to **true** for the server group.', example='Insert'),
  }(name='StickySessionConfig', description='The configuration of session persistence.'),
  uchConfig?: {
    type?: string(name='Type', description='The type of the parameter. Only query strings are supported.

This parameter is required.', example='QueryString'),
    value?: string(name='Value', description='The value of the parameter used for consistent hashing.

This parameter is required.', example='abc'),
  }(name='UchConfig', description='The configurations of consistent hashing based on URLs.'),
  upstreamKeepaliveEnabled?: boolean(name='UpstreamKeepaliveEnabled', description='Specifies whether to enable persistent TCP connections.', example='true'),
}

model UpdateServerGroupAttributeResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous job.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model UpdateServerGroupAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateServerGroupAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the configurations of a server group, such as health checks, session persistence, server group names, routing algorithms, and protocols.
 *
 * @description ## Description
 * **UpdateServerGroupAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the status of a server group:
 * *   If a server group is in the **Configuring** state, the configuration of the server group is being modified.
 * *   If a server group is in the **Available** state, the configuration of the server group is modified.
 *
 * @param request UpdateServerGroupAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateServerGroupAttributeResponse
 */
async function updateServerGroupAttributeWithOptions(request: UpdateServerGroupAttributeRequest, runtime: $RuntimeOptions): UpdateServerGroupAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.connectionDrainConfig)) {
    query['ConnectionDrainConfig'] = request.connectionDrainConfig;
  }
  if (!$isNull(request.crossZoneEnabled)) {
    query['CrossZoneEnabled'] = request.crossZoneEnabled;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.healthCheckConfig)) {
    query['HealthCheckConfig'] = request.healthCheckConfig;
  }
  if (!$isNull(request.scheduler)) {
    query['Scheduler'] = request.scheduler;
  }
  if (!$isNull(request.serverGroupId)) {
    query['ServerGroupId'] = request.serverGroupId;
  }
  if (!$isNull(request.serverGroupName)) {
    query['ServerGroupName'] = request.serverGroupName;
  }
  if (!$isNull(request.serviceName)) {
    query['ServiceName'] = request.serviceName;
  }
  if (!$isNull(request.slowStartConfig)) {
    query['SlowStartConfig'] = request.slowStartConfig;
  }
  if (!$isNull(request.stickySessionConfig)) {
    query['StickySessionConfig'] = request.stickySessionConfig;
  }
  if (!$isNull(request.uchConfig)) {
    query['UchConfig'] = request.uchConfig;
  }
  if (!$isNull(request.upstreamKeepaliveEnabled)) {
    query['UpstreamKeepaliveEnabled'] = request.upstreamKeepaliveEnabled;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateServerGroupAttribute',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the configurations of a server group, such as health checks, session persistence, server group names, routing algorithms, and protocols.
 *
 * @description ## Description
 * **UpdateServerGroupAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the status of a server group:
 * *   If a server group is in the **Configuring** state, the configuration of the server group is being modified.
 * *   If a server group is in the **Available** state, the configuration of the server group is modified.
 *
 * @param request UpdateServerGroupAttributeRequest
 * @return UpdateServerGroupAttributeResponse
 */
async function updateServerGroupAttribute(request: UpdateServerGroupAttributeRequest): UpdateServerGroupAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateServerGroupAttributeWithOptions(request, runtime);
}

model UpdateServerGroupServersAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** may be different for each request.', example='593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

This parameter is required.', example='sgp-atstuj3rtop****'),
  servers?: [ 
    {
      description?: string(name='Description', description='The description of the backend server. The description must be 2 to 256 characters in length, and cannot start with http:// or https://.', example='test'),
      port?: int32(name='Port', description='The port that is used by the backend server. Valid values: **1** to **65535**.

> You do not need to set this parameter if **ServerType** is set to **Fc**.', example='80'),
      serverId?: string(name='ServerId', description='The ID of the backend server.

*   Specify the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance if you set **ServerType** to **Ecs**, **Eni**, or **Eci**.
*   Specify an IP address if you set **ServerType** to **Ip**.
*   Specify the Alibaba Cloud Resource Name (ARN) of a Function Compute function if you set **ServerType** to **Fc**.

This parameter is required.', example='i-bp1f9kdprbgy9uiu****'),
      serverIp?: string(name='ServerIp', description='The IP address of the backend server.', example='192.168.1.1'),
      serverType?: string(name='ServerType', description='The type of the backend server. Valid values:

*   **Ecs**: ECS instance
*   **Eni**: ENI
*   **Eci**: elastic container instance
*   **Ip**: IP address
*   **Fc**: Function Compute

This parameter is required.', example='Ecs'),
      weight?: int32(name='Weight', description='The weight of the backend server. Valid values: **0** to **100**. Default value: **100**. If the value is set to **0**, no requests are forwarded to the server. You can specify up to 40 servers in each call.

> You do not need to set this parameter if **ServerType** is set to **Fc**.', example='100'),
    }
  ](name='Servers', description='The server groups. You can specify at most 40 server groups in each call.

This parameter is required.'),
}

model UpdateServerGroupServersAttributeResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous job.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model UpdateServerGroupServersAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateServerGroupServersAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the configurations, such as the backend server weight and description, of a server group.
 *
 * @description **UpdateServerGroupServersAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background.
 * 1.  You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the status of a server group.
 *     *   If a server group is in the **Configuring** state, it indicates that the server group is being modified.
 *     *   If a server group is in the **Available** state, it indicates that the server group is running.
 * 2.  You can call the [ListServerGroupServers](https://help.aliyun.com/document_detail/213628.html) operation to query the status of a backend server.
 *     *   If a backend server is in the **Configuring** state, it indicates that the backend server is being modified.
 *     *   If a backend server is in the **Available** state, it indicates that the backend server is running.
 *
 * @param request UpdateServerGroupServersAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateServerGroupServersAttributeResponse
 */
async function updateServerGroupServersAttributeWithOptions(request: UpdateServerGroupServersAttributeRequest, runtime: $RuntimeOptions): UpdateServerGroupServersAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.serverGroupId)) {
    query['ServerGroupId'] = request.serverGroupId;
  }
  if (!$isNull(request.servers)) {
    query['Servers'] = request.servers;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateServerGroupServersAttribute',
    version = '2020-06-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the configurations, such as the backend server weight and description, of a server group.
 *
 * @description **UpdateServerGroupServersAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background.
 * 1.  You can call the [ListServerGroups](https://help.aliyun.com/document_detail/213627.html) operation to query the status of a server group.
 *     *   If a server group is in the **Configuring** state, it indicates that the server group is being modified.
 *     *   If a server group is in the **Available** state, it indicates that the server group is running.
 * 2.  You can call the [ListServerGroupServers](https://help.aliyun.com/document_detail/213628.html) operation to query the status of a backend server.
 *     *   If a backend server is in the **Configuring** state, it indicates that the backend server is being modified.
 *     *   If a backend server is in the **Available** state, it indicates that the backend server is running.
 *
 * @param request UpdateServerGroupServersAttributeRequest
 * @return UpdateServerGroupServersAttributeResponse
 */
async function updateServerGroupServersAttribute(request: UpdateServerGroupServersAttributeRequest): UpdateServerGroupServersAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateServerGroupServersAttributeWithOptions(request, runtime);
}

